I use Anaconda for Python 2.7.10 in Windows 7, 64 bit. I also use Visual Studio 2010. I installed Microsoft Visual Studio for Python.
When I try to compile a C code in python (inside cmd):
C:\Anaconda\sms-tools-master\software\transformations_interface>python compileModule.py build_ext --inplace
I get a lot of warnings and some errors that the final part of it are as follows:
C:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\BIN\amd64\link.exe /DLL / nologo /INCREMENTAL:NO /LIBPATH:C:\Anaconda\libs /LIBPATH:C:\Anaconda\PCbuild\am d64 m.lib
/EXPORT:initutilFunctions_C build\temp.win-amd64-2.7\Release\utilFunct
ions.obj build\temp.win-amd64-2.7\Release\cutilFunctions.obj
/OUT:C:\Anaconda\sm
s-tools-master\software\models\utilFunctions_C\utilFunctions_C.pyd
/IMPLIB:build \temp.win-amd64-2.7\Release\utilFunctions_C.lib
/MANIFESTFILE:build\temp.win-amd
64-2.7\Release\utilFunctions_C.pyd.manifest LINK : fatal error
LNK1181: cannot open input file 'm.lib' error: command 'C:\\Program
Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\ amd64\\link.exe'
failed with exit status 1181
Please let me see how this problem can be fixed.
And if I only comment
and use
then I get lots of warning (not errors hopefully) whose final part is:
I think the problem is now resolved. Thank you LPs!!
Just removing ..
libraries=['m']
.. from ext_modules helped me compile on windows 2010 too. No errors or warnings. This is how it looks finally,Thanks a bunch
Edit .....
Here is entire code for
compileModule.py
Please refer to comments for details.Comment the line in
setup.py
that saylibraries=['m']
, and run again.The need to link to m might be a GCC thing to link Math library, that is managed by MSVCR in Windows environment.