python23_d.lib

S

Shankar KN

Hi,

I am trying to get a hand on python23_d.lib but in vain.
I am developing a C++ dll which has a SWIG interface to the Python world.
After installing Python and SWIG I am able to build this DLL in Release mode
but not in Debug mode beacuse of non-availability of python23_d.lib.

Any clues as to how I could proceed with Debug build?

Thanks,
With best regards,
Shankar
 
G

Gary Herron

Hi,

I am trying to get a hand on python23_d.lib but in vain.
I am developing a C++ dll which has a SWIG interface to the Python world.
After installing Python and SWIG I am able to build this DLL in Release
mode but not in Debug mode beacuse of non-availability of python23_d.lib.

Any clues as to how I could proceed with Debug build?

Thanks,
With best regards,
Shankar

I just copied python23.lib to the proper spot renaming it to
python23_d.lib. I suppose this is not an ideal solution, but it did
shutup the complaints so I could proceed.

Perhaps someone (else) can provide a "real" solution,

Gary Herron
 
T

Thomas Heller

Shankar KN said:
Hi,

I am trying to get a hand on python23_d.lib but in vain.
I am developing a C++ dll which has a SWIG interface to the Python world.
After installing Python and SWIG I am able to build this DLL in Release mode
but not in Debug mode beacuse of non-availability of python23_d.lib.

Any clues as to how I could proceed with Debug build?

Get the Python sources and make a debug build.

Thomas
 
S

Steve Menard

Shankar said:
Hi,

I am trying to get a hand on python23_d.lib but in vain.
I am developing a C++ dll which has a SWIG interface to the Python world.
After installing Python and SWIG I am able to build this DLL in Release mode
but not in Debug mode beacuse of non-availability of python23_d.lib.

Any clues as to how I could proceed with Debug build?

Thanks,
With best regards,
Shankar

What I usually is grab the sources and create a debug build myself.
SHould be pretty easy and painless to do no matter what platform you
use. keep in mind its not only the python23_d.lib that you need, but
also the python_d.exe and python23_d.dll, along with _d version of any
extension modules you use.

python the _d versions in the same place you find the regular works for me.

Steve
 
B

Bryan

Shankar said:
Hi,

I am trying to get a hand on python23_d.lib but in vain.
I am developing a C++ dll which has a SWIG interface to the Python world.
After installing Python and SWIG I am able to build this DLL in Release mode
but not in Debug mode beacuse of non-availability of python23_d.lib.

Any clues as to how I could proceed with Debug build?

Thanks,
With best regards,
Shankar

this is the simplest approach i've found. i just add this around the python.h include.

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


bryan
 
M

Miki Tebeka

Hello Bryan,
this is the simplest approach i've found. i just add this around the
python.h include.

#ifdef _DEBUG
I think the following line is missing.
#undef _DEBUG
#include <Python.h>
#define _DEBUG
#else
#include <Python.h>
#endif

Bye.
 
B

Bryan

Miki said:
Hello Bryan,



I think the following line is missing.
#undef _DEBUG



Bye.
--

yes, of course... sorry, i shoud have copied it from me code instead of just writing it here.

thanks,

bryan
 
S

Shankar KN

Hi,

Thanks for the reply.
But the problem persists.

There is only place where I do a #include <Python.h> (its in a .i file)
I did what you suggested around this include.

the problem is that running SWIG on this .i generates a .cxx file which we
don't want to modify.
This .cxx file has multiple occurences of #include <Python.h>, and only one
occurence gets the "guard" against _DEBUG.

Am I missing something here?
 
B

Bryan

Shankar said:
Hi,

Thanks for the reply.
But the problem persists.

There is only place where I do a #include <Python.h> (its in a .i file)
I did what you suggested around this include.

the problem is that running SWIG on this .i generates a .cxx file which we
don't want to modify.
This .cxx file has multiple occurences of #include <Python.h>, and only one
occurence gets the "guard" against _DEBUG.

Am I missing something here?


sorry, i don't use swig, so i'm no going be able to help you with that. but couldn't you write a python post-process
script that modifies the file automatically when compiled debug? if this is too much of a pain, then maybe compiling a
debug version of python would be your simplest solution.

bryan
 
T

Tonetheman

The real problem that you are having is from these lines in the
pyconfig.h file that you include.
#ifdef MS_COREDLL
# ifndef Py_BUILD_CORE /* not building the core - must be an ext */
# if defined(_MSC_VER)
/* So MSVC users need not specify the .lib file in
their Makefile (other compilers are generally
taken care of by distutils.) */
# ifdef _DEBUG
# pragma comment(lib,"python23_d.lib")
# else
# pragma comment(lib,"python23.lib")
# endif /* _DEBUG */
# endif /* _MSC_VER */
# endif /* Py_BUILD_CORE */
#endif /* MS_COREDLL */

So if you want you should be able to change your source to something
like this:

#undef _DEBUG
#include <python.h>
#define _DEBUG

Or if you want to you could just hack up pyconfig.h to remove the
pragma that forces the debug version library...

Or finally just get the sources and build the debug library yourself.

Tone
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top