Problem building extension under Cygwin (ImportError: Bad address)

Jason Tishler jason at
Thu May 4 17:55:08 CEST 2006

On Thu, May 04, 2006 at 06:23:23AM -0700, Lars wrote:
> But first compiling hello.c with gcc, then linking it with gnu-ld just
> won't work. I only really need to compile one C-file to a shared
> library so it doesn't matter so much for me. But bigger projects will
> have a problem..

No, it works if you drive it from gcc:

    $ gcc -I/usr/include/python2.4 -c hello.c
    $ gcc -shared -o hello.dll hello.o -L/usr/lib/python2.4/config -lpython2.4
    $ python 
    Hello, C
    Hello, module /tmp/examples/PP2E/Integrate/Extend/Hello/hello.dll
    Hello, 0
    Hello, 1
    Hello, 2

BTW, if you use Distutils, then it will just work...


PGP/GPG Key: or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

More information about the Python-list mailing list