Failed to compile mex in Matlab 2014a

476 Views Asked by At

I was trying to compile a .c file in Matlab 2014a on a Windows 7(64-bit) machine. The compiler was a Mingw-w64 gcc:

mex -lsundials_nvecserial -lsundials_cvode -lm -IC:/sundials/include -LC:/sundials/lib model_pike_cvode.c

Then it gave me some error:

Error using mex
gcc: error: sundials_nvecserial.lib: No such file or directory
gcc: error: sundials_cvode.lib: No such file or directory
gcc: error: libm.lib: No such file or directory

First of all, I am pretty sure that "sundials_nvecserial.lib" and "sundials_cvode.lib" are under the "C:/sundials/lib/" folder, which is indicated in the command after the -L option.

Second, I am aware that I don't have a libm.lib in my machine. I need the option because the .c file '#include '. I have a Visual Studio installed though I was not using it. I can find 'math.h' but not 'libm.lib' in it. So I guess the question is, how to tweak/avoid the '-lm' option on a Windows machine.

Thank you in advance,

John

0

There are 0 best solutions below