Mex - Compiler doesn't include *.lib but they are there!

2 次查看(过去 30 天)
Hi,
I am using Matlab 2013a 64 Bit with the supported compiler from the Microsoft SDK 7.1, so far so good. I want to include some "*.lib" into my mex file that are needed, first idea was to include the whole directory with -L for the libs and -I for the headers needed. This worked well with some other mex files but with this file it fails. So I tried to include the libs directly using -l and this error message comes to the command window:
Warning: MEX could not find the library "D:\Sapera\Lib\Win64\SapClassBasic" specified with -l option.
MEX looked for a file with one of the names:
D:\Sapera\Lib\Win64\SapClassBasic.lib
libD:\Sapera\Lib\Win64\SapClassBasic.lib
MEX looked for the library in the following directories:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\LIB\amd64
C:\Program Files\Microsoft SDKs\Windows\v7.1\LIB\X64
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\ATLMFC\LIB\AMD64
C:\Program Files\MATLAB\R2013a\extern\lib\win64
C:\Program Files\MATLAB\R2013a\extern\lib\win64\microsoft
D:\Sapera\Lib\Win64\
D:\Sapera\Lib\Win64\VS2010
C:\WinDDK\7600.16385.1\lib\Mfc
C:\WinDDK\7600.16385.1\lib\win7\amd64
The lib is there but the compiler doesn't find it and i so far don't know how to fix it, do you have an idea?

采纳的回答

Friedrich
Friedrich 2013-8-12
编辑:Friedrich 2013-8-12
Hi,
it seems like you specified the full name to the lib file. That is not needed. with -L flag you specifiy the folders to look in and with -l you specify the filename only, e.g.
mex yourcode.c -LD:\Sapera\Lib\Win64\ -lSapClassBasic

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Write C Functions Callable from MATLAB (MEX Files) 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by