FAQ
Has anybody used SWIG with Python on Windows without Microsoft Visual
C++? I'm having problems getting the hellolib example in the
Extending Python chapter from "Programming Python" to compile with
gcc. I'm getting undefined reference errors to "Py..." functions, ex:
PyString_FromString. All the examples I can find on the web use MSVC
and I can't find an example for compiling a DLL using a makefile.

BTW: Has anybody on this list done an integration between Perforce
and PVCS Tracker? The above issue is holding me up from using P4DTI,
which otherwise looks like a decent solution.

thanks,
DD

Search Discussions

  • Gerhard Häring at Nov 2, 2001 at 7:10 pm

    On Fri, Nov 02, 2001 at 11:47:53AM -0800, DD wrote:
    Has anybody used SWIG with Python on Windows without Microsoft Visual
    C++? I'm having problems getting the hellolib example in the
    Extending Python chapter from "Programming Python" to compile with
    gcc. I'm getting undefined reference errors to "Py..." functions, ex:
    PyString_FromString.
    All the examples I can find on the web use MSVC and I can't find an
    example for compiling a DLL using a makefile.
    Madness lies down that path. I'd recommend you enter the beautiful land
    of Python distutils instead. Building an extension on Windows is
    relatively painless then.

    First, you need to create an import library for gcc. Have a look at the
    HOWTO I posted here in August on how to do this and other useful tips
    for developing and debugging on Windows with gcc:

    http://mail.python.org/pipermail/python-list/2001-August/061125.html

    - write a setup.py for it
    - "python setup.py build --compiler=mingw32" (or install, or even
    bdist_wininst)

    As for the SWIG part of your problem, I'd just create the .c and .h
    files for setup.py, then use python setup.py to build. I remember having
    seen SWIG integration with distutils somewhere, but don't remember
    where.

    Gerhard
    --
    mail: gerhard <at> bigfoot <dot> de registered Linux user #64239
    web: http://www.cs.fhm.edu/~ifw00065/ OpenPGP public key id 86AB43C0
    public key fingerprint: DEC1 1D02 5743 1159 CD20 A4B6 7B22 6575 86AB 43C0
    reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedNov 2, '01 at 7:10p
activeNov 2, '01 at 7:47p
posts2
users2
websitepython.org

2 users in discussion

Gerhard Häring: 1 post DD: 1 post

People

Translate

site design / logo © 2023 Grokbase