MATLAB: MEX cannot find library ‘m’ specified with the -l option

MATLAB Compilermex compiler

I compiling some c files to make mex files in windows 10 64-bit operating system. but when I run it gives the following error:
Error using mex
MEX cannot find library 'm' specified with the -l option.
MEX looks for a file with one of the names:
m.lib
libm.lib
Please specify the path to this library with the -L option.
Error in make (line 17)
mex CC=g++ -lm get_full_speed.c

Best Answer

I see a hint that libm might be built in for MinGW. Try without the -lm