Cython with Visual Studio (Windoes SDK package) compiler cl.exe to create
a .pyd
I am trying to compile a .c file create by Cython to a .pyd file using
cl.exe, which comes with the Microsoft Windows SDK.
Since this is the recommended package to build Cython under Windows 7 64
bit for Python 2.7 64 bit, I thought it would be a good idea to use the
same compiler to create the .pyd files.
My current call uses a cythoncc.bat file with:
set CLPATH="C:\Program Files (x86)\Microsoft Visual Studio
9.0\VC\bin\amd64\cl.exe"
SET INCLUDE="C:\Program Files (x86)\Microsoft Visual Studio
9.0\VC\include";"C:\Program Files\Microsoft
SDKs\Windows\v7.0\Include";"C:\Python27\include";"C:\Python27\Lib\site-packages\numpy\core\include";
SET LIB="C:\Python27\libs";"C:\Program Files (x86)\Microsoft Visual Studio
9.0\VC\lib\amd64";"C:\Program Files\Microsoft SDKs\Windows\v7.0\Lib\x64";
SET CFLAGS="/O2 /favor:<INTEL64>"
%CLPATH% %CFLAGS% /Fo%1.pyd %2.c
I think the problem is in the last line, but not sure yet... it gives me
the error:
/out:_conecyl.exe
_conecyl.pyd
Creating library _conecyl.lib and object _conecyl.exp
LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol main
referenced
in function __tmainCRTStartup
_conecyl.exe : fatal error LNK1120: 1 unresolved externals
And creates a .pyd plus a .lib file.
Any help will be very appreciated! Thank you!
No comments:
Post a Comment