MATLAB: Do I receive an error message when building a MEX-file with the LCC compiler in MATLAB

errorlcclinkflagsMATLABmex

Why do I receive the error message "Can't find the path of the lcc libraries.(libc.lib missing)" when build a MEX-file with the LCC compiler in MATLAB?
I am attempting to compile and link a MEX-file using the MEX command from the DOS prompt. One thing I am doing is trying to append some linker options to the MEX build by using the LINKFLAGS#"$LINKFLAGS option. However, I seem to be consistently getting the following error message:
Can't find the path of the lcc libraries.(libc.lib missing)
Please enter it now: (for example c:\lcc\lib)
Directory does not exist. I quit
C:\ENGAPPS\MATHWORKS\MATLAB6P5\BIN\WIN32\MEX.PL: Error: Link of 'sfun_atmos1.dll' failed.

Best Answer

This problem typically occurs if you are defining the /LIBPATH flag with a colon, which is not valid. Instead, you should leave a space between the /LIBPATH flag and the option it defines as the following command illustrates:
mex -v LINKFLAGS#"$LINKFLAGS dformd.lib dfconsol.lib dfport.lib
/LIBPATH $DF_ROOT\ DF98\LIB" sfun_atmos1.c sfun_atmos_sub.obj