WindowsXP development using msvc .net 2003

Discussion in 'Python' started by Michael O'Brien, Dec 7, 2005.

  1. 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
     
    Michael O'Brien, Dec 7, 2005
    #1
    1. Advertising

  2. Michael O'Brien wrote:
    > 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
     
    Scott David Daniels, Dec 7, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SpamProof
    Replies:
    0
    Views:
    655
    SpamProof
    Oct 21, 2003
  2. Andrius B.

    ASP on WindowsXP

    Andrius B., Feb 7, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    424
    Andrius B.
    Feb 8, 2006
  3. Replies:
    1
    Views:
    461
    Roedy Green
    Nov 2, 2005
  4. Manfred Eckschlager

    Sockets and filebuf with msvc 2003

    Manfred Eckschlager, Jul 19, 2004, in forum: C++
    Replies:
    2
    Views:
    546
    tom_usenet
    Jul 19, 2004
  5. Replies:
    4
    Views:
    398
Loading...

Share This Page