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!
Did you include arrayobject.h and call import_array() in the initialization function, after the call to Py_InitModule() ? --- Danny Chan <chan_dhf@yahoo.de> wrote:
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
[cut]
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
-- Lou Pecora, my views are my own. ____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
Yes, that is not the problem. The compiling of the source file works fine, it is when the linker tries to create the shared library file that something blows up. Lou Pecora <lou_boog2000@yahoo.com> schrieb: Did you include arrayobject.h and call import_array() in the initialization function, after the call to Py_InitModule() ? --- Danny Chan wrote:
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
[cut]
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
-- Lou Pecora, my views are my own. ____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion --------------------------------- Heute schon einen Blick in die Zukunft von E-Mails wagen? Versuchen Sie´s mit dem neuen Yahoo! Mail.
Ha, found the problem! I thought I had included arrayobject.h and import_array correctly, but due to the preprocessor it wasn't defined correctly! Danny Chan <chan_dhf@yahoo.de> schrieb: Yes, that is not the problem. The compiling of the source file works fine, it is when the linker tries to create the shared library file that something blows up. Lou Pecora <lou_boog2000@yahoo.com> schrieb: Did you include arrayobject.h and call import_array() in the initialization function, after the call to Py_InitModule() ? --- Danny Chan wrote:
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
[cut]
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
-- Lou Pecora, my views are my own. ____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion --------------------------------- Heute schon einen Blick in die Zukunft von E-Mails wagen? Versuchen Sie´s mit dem neuen Yahoo! Mail. _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion --------------------------------- Heute schon einen Blick in die Zukunft von E-Mails wagen? Versuchen Sie´s mit dem neuen Yahoo! Mail.
participants (2)
-
Danny Chan
-
Lou Pecora