Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LNK1181: cannot open input file 'm.lib'

When trying to install a certain Python geophysical toolkit, I get this error:

LINK : fatal error LNK1181: cannot open input file 'm.lib'

I believe it is due to my use of the MSVC's buildtools. In their setup.py I found:

setup(…, ext_modules=[ Extension(…, […], libraries=['m'], … ])

What do I need to change in this setup.py—and related files?—to make this work. IIRC there is a library other than m which I am to use.

like image 342
A T Avatar asked Oct 12 '13 11:10

A T


1 Answers

On Windows, the standard math functions are handled by MSVCR:

>>> from ctypes.util import find_library
>>> find_library('m')
'msvcr90.dll'

I don't have MSVC installed to test, but you just need to link against the runtime. Try removing 'm'.

like image 164
Snorfalorpagus Avatar answered Oct 17 '22 12:10

Snorfalorpagus