473,405 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

loading modules in debug

The project I'm working on is written mainly C/C++, spiced with some
Python scripts. Now, I have several dlls, which work both as a Python
extension modules, exporting functions to Python via "initmodule", and
as normal dynamic libraries, to which I link dynamically from within my
C program.

The problem is that, in debug mode, Python expects every module name to
be postfixed with _d, which makes my dynamic loading (using LoadLibrary)
not work, unless I #ifdef it everywhere, and append _d to the dlls
myself. I could do this, but I don't really like the idea. I'd be happy
to use the release python interpreter in debug mode too, but the python
header automatically pulls in the debug version.

Any ideas/suggestions what could I do?

thanks,
Andras
Jan 26 '06 #1
1 1352
[I haven't seen an answer for this older question, so I figured I'd go
ahead and post one]

Andras Balogh wrote:

The problem is that, in debug mode, Python expects every module name to
be postfixed with _d, which makes my dynamic loading (using LoadLibrary)
not work, unless I #ifdef it everywhere, and append _d to the dlls
myself. I could do this, but I don't really like the idea. I'd be happy
to use the release python interpreter in debug mode too, but the python
header automatically pulls in the debug version.

Any ideas/suggestions what could I do?


The easiest way to avoid this behavior on Windows is to replace the
code where you #include <Python.h> with something like this:

#ifdef _DEBUG
#undef _DEBUG
#include <Python.h>
#define _DEBUG
#else
#include <Python.h>
#endif

This should cause Python to stop looking for the _d named dlls.

-greg

Jan 31 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: fowlertrainer | last post by:
Hello ! I have used mod_python. But it is don't reload my modules when I editing them. I try with this: -------------------- # Module importer import os import traceback
1
by: Kent Rollins | last post by:
I am writing a server and an MMC console app that use remoting to talk to each other. The MMC client and the server share a couple of assemblies: one has the interface that is remoted from the...
4
by: deko | last post by:
This is a basic program flow question. I'm trying to refractor an AC2000 app and split sections of code into separate modules. But there are a number of collections I create in one big module -...
4
by: MLH | last post by:
If I test the integrity of my code, opening a module, clicking Debug, Compile All Modules, the process stops at the first occurrence of a coding error. Can I skip that and go on somehow (you know,...
1
by: Carl Bolstad | last post by:
I'm writing a C# class library, to be registered as COM and used as an extension to a commercial application called ArcMap. This approach has worked great for a long time, until... ...
0
by: Terry Tang | last post by:
Hi There, We are extending Python interpreter to support special functions of our tools. What we did is to compile Python's source code (which is got from the an installation on a Linux...
7
by: 2b|!2b==? | last post by:
I am attempting to manually load debug symbols for a module. I am doing it by carrying out the ff steps: i). Select the call stack window ii). right click and select 'Load Symbols' from...
4
by: bhood2 | last post by:
I've come to the conclusion that posting about Embedded Python on the Python forums is a complete waste of time. I hope I can get some useful insights here. I'm looking for some help with...
3
by: sandro | last post by:
Hi, I had two packages working fine toghether: debug and sqlkit. Debug provides a metaclass just for debuggging purposes to sqlkit (to log methods following a recipe on ASPN. It worked very...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.