[Numpy-discussion] compiling c extension

Danny Chan chan_dhf@yahoo...
Mon Jan 21 10:26:03 CST 2008


Hi!
I am trying to compile a c extension that uses numpy arrays on windows. I can compile the extension file, but once I get to the linking stage I get unresolved references to PyArray_API and import_array. Can anyone help me with the correct linker flags? 

Thanks, Danny



running build
running build_py
file libaid.py (for module libaid) not found
file libaid.py (for module libaid) not found
running build_ext
building '_libaid' extension
writing build\temp.win32-2.5\Release\.\python\_libaid.def
x:\eda\mingw\5.1.3\bin\gcc.exe -mno-cygwin -shared -s build\temp.win32-2.5\Release\.\python\libaid_wrap.o build\temp.win32-2.5\Release\.\python\_libaid.def -L../../build/win32/bin -Lx:\eda\python\windows\libs -Lx:\eda\python\windows\PCBuild -laid -lpython25 -lmsvcr71 -o build\lib.win32-2.5\_libaid.pyd
build\temp.win32-2.5\Release\.\python\libaid_wrap.o:libaid_wrap.c:(.text+0x2602): undefined reference to `PyArray_API'
build\temp.win32-2.5\Release\.\python\libaid_wrap.o:libaid_wrap.c:(.text+0x2635): undefined reference to `PyArray_API'
build\temp.win32-2.5\Release\.\python\libaid_wrap.o:libaid_wrap.c:(.text+0x264f): undefined reference to `PyArray_API'
build\temp.win32-2.5\Release\.\python\libaid_wrap.o:libaid_wrap.c:(.text+0x2709): undefined reference to `PyArray_API'
build\temp.win32-2.5\Release\.\python\libaid_wrap.o:libaid_wrap.c:(.text+0x2752): undefined reference to `PyArray_API'
build\temp.win32-2.5\Release\.\python\libaid_wrap.o:libaid_wrap.c:(.text+0x2784): more undefined references to `PyArray_API' follow
build\temp.win32-2.5\Release\.\python\libaid_wrap.o:libaid_wrap.c:(.text+0xc216): undefined reference to `import_array'
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

       
---------------------------------
Beginnen Sie den Tag mit den neuesten Nachrichten. Machen Sie Yahoo! zu Ihrer Startseite!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080121/f7ab0bc3/attachment.html 


More information about the Numpy-discussion mailing list