MATLAB: Libraries

MATLABMATLAB Compiler

Hello! I continue to suffer with the included files and libraries. I can't understand, why there is a following error:
>> mex -IC:\OgreSDK\samples\include -IC:\OgreSDK\include -LC:\OgreSDK\lib OgreAppSource.cpp -l OgreMain_d.lib -l OIS_d.lib
Warning: MEX could not find the library "" specified with -l option.
MEX looked for a file with one of the names:
.lib
lib.lib
MEX looked for the library in the following directories:
C:\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB
C:\Program Files\Microsoft Visual Studio 9.0\VC\LIB
C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib
C:\Program Files\Microsoft Visual Studio 9.0\SDK\v2.0\lib
C:\Program Files\MATLAB\R2010b\extern\lib\win32
C:\Program Files\SQLXML 4.0\bin\
C:\Program Files\MATLAB\R2010b\extern\lib\win32\microsoft
C:\OgreSDK\lib
Warning: MEX could not find the library "" specified with -l option.
MEX looked for a file with one of the names:
.lib
lib.lib
MEX looked for the library in the following directories:
C:\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB
C:\Program Files\Microsoft Visual Studio 9.0\VC\LIB
C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib
C:\Program Files\Microsoft Visual Studio 9.0\SDK\v2.0\lib
C:\Program Files\MATLAB\R2010b\extern\lib\win32
C:\Program Files\SQLXML 4.0\bin\
C:\Program Files\MATLAB\R2010b\extern\lib\win32\microsoft
C:\OgreSDK\lib
LINK : fatal error LNK1181: cannot open input file 'OgreMain_d.lib'
C:\PROGRA~1\MATLAB\R2010B\BIN\MEX.PL: Error: Link of 'OgreAppSource.mexw32' failed.
??? Error using ==> mex at 208
Unable to complete successfully.
I will be grateful for any help.

Best Answer

I'm sorry, I think I made a mistake in my answer to your previous question - there should be no blankspace between -l and your library name. Also, you don't need to add the .lib extension since MEX does that automatically for you. Try:
>> mex -IC:\OgreSDK\samples\include -IC:\OgreSDK\include -LC:\OgreSDK\lib OgreAppSource.cpp -lOgreMain_d -lOIS_d
Related Question