WindowsXP development using msvc .net 2003

  • Thread starter Michael O'Brien
  • Start date
M

Michael O'Brien

Hola~

I'm developing a c++ library that contains python types and methods on
Windows using MSVC .net 2003 and g++ on Linux.

To compile on Linux, I just compile and I can use a debug compiled
version of my plugin in a vanilla python interpreter. On Windows, it
seems like you have to compile a custom version of python and then
compile my plugin against the debug version of python.

Is that right? I guess I don't understand why the Windows distribution
of Python includes the headers and libraries if only an optimized
plugin could access it. I've compiled my own version of Python (it
worked out of the box), but I wouldn't think I would need to.

Now, I'd like to update my plugin to be able to export a Numeric array
type. On Linux, I just point the compiler at the headers, and it all
seems to work. On Windows, do I have to compile a debug version of
Numeric to do so?

I feel like I'm making things harder than they need to be on Windows.
Any advice on building Python modules on both Windows and Linux would
be appreciated.

MO
 
S

Scott David Daniels

Michael said:
Hola~

I'm developing a c++ library that contains python types and methods on
Windows using MSVC .net 2003 and g++ on Linux.

.... On Windows, it seems like you have to compile a custom version of
python and then compile my plugin against the debug version of python.
Is that right? Nope.

I guess I don't understand why the Windows distribution
of Python includes the headers and libraries if only an optimized
plugin could access it.
You do need compatible C/C++ libraries for both Python and your module.
Microsoft feels free to change calling conventions and layouts of
some essential data structures (such as the thing pointed to by a FILE*)
between releases of their C/C++ compilers, and depending upon whether
the debug flag is on. On Linux, I'm sure you could buy an exotic C/C++
system from some vendor that produces hyper-optimizing code that would
not mesh well with the pre-built Python. The issue you see is a C/C++
compiler issue.
> I've compiled my own version of Python (it
worked out of the box), but I wouldn't think I would need to.
You don't need to.
Now, I'd like to update my plugin to be able to export a Numeric array
type. On Linux, I just point the compiler at the headers, and it all
seems to work. On Windows, do I have to compile a debug version of
Numeric to do so?
If you are not using a compatible compiler w/ flags, then yes.
I feel like I'm making things harder than they need to be on Windows.
Any advice on building Python modules on both Windows and Linux would
be appreciated.
It does matter which version of python you are discussing -- 2.4
switched from VC 6.0 as the compiler to VC 7.1 (the .net 2003 compiler).
If you are working with 2.3.* or earlier you _will_ need to recompile.
If you are working with 2.4.* or later, your compiler will work, but
it may not work if you turn on debugging.

You might take a look at the vrplumber page, that may help:
http://www.vrplumber.com/programming/mstoolkit

I also have some code to "monkey patch" distutils (change at runtime
without having to alter any source code) if distutils seems to
be the problem.

--Scott David Daniels
(e-mail address removed)
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top