编译错误(MEX无法找到库) [英] Compile Error ( MEX could not find the library )

查看:400
本文介绍了编译错误(MEX无法找到库)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
我正在使用matlab 2013a x64和win7 x64。安装opencv路径(C:\ openncv)



编译错误:



hi i'm using matlab 2013a x64 and win7 x64 . install the opencv path (C:\opencv)

Compile Error :

>> mex -LC:\opencv\build\x64\vc11\lib -IC:\opencv\build\include\opencv -lcv -lcxcore me_HaarDetectOpenCV.cpp
 
Warning: MEX could not find the library "cv" specified with -l option. 
         MEX looked for a file with one of the names: 
               cv.lib 
               libcv.lib 
         MEX looked for the library in the following directories: 
               D:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\LIB\amd64 
               D:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\ATLMFC\LIB\amd64 
               C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x64 
               D:\Program Files\MATLAB\R2013a\extern\lib\win64 
               D:\Program Files\MATLAB\R2013a\extern\lib\win64\microsoft 
               C:\opencv\build\x64\vc11\lib 
 
 
Warning: MEX could not find the library "cxcore" specified with -l option. 
         MEX looked for a file with one of the names: 
               cxcore.lib 
               libcxcore.lib 
         MEX looked for the library in the following directories: 
               D:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\LIB\amd64 
               D:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\ATLMFC\LIB\amd64 
               C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x64 
               D:\Program Files\MATLAB\R2013a\extern\lib\win64 
               D:\Program Files\MATLAB\R2013a\extern\lib\win64\microsoft 
               C:\opencv\build\x64\vc11\lib 
 
   Creating library C:\Users\AsUs\AppData\Local\Temp\mex_47j5SQ\templib.x and object C:\Users\AsUs\AppData\Local\Temp\mex_47j5SQ\templib.exp 
me_HaarDetectOpenCV.obj : error LNK2019: unresolved external symbol cvCreateImage referenced in function mexFunction 
me_HaarDetectOpenCV.obj : error LNK2019: unresolved external symbol cvReleaseImage referenced in function mexFunction 
me_HaarDetectOpenCV.obj : error LNK2019: unresolved external symbol cvCreateMemStorage referenced in function mexFunction 
me_HaarDetectOpenCV.obj : error LNK2019: unresolved external symbol cvReleaseMemStorage referenced in function mexFunction 
me_HaarDetectOpenCV.obj : error LNK2019: unresolved external symbol cvGetSeqElem referenced in function mexFunction 
me_HaarDetectOpenCV.obj : error LNK2019: unresolved external symbol cvLoad referenced in function mexFunction 
me_HaarDetectOpenCV.obj : error LNK2019: unresolved external symbol cvEqualizeHist referenced in function mexFunction 
me_HaarDetectOpenCV.obj : error LNK2019: unresolved external symbol cvReleaseHaarClassifierCascade referenced in function mexFunction 
me_HaarDetectOpenCV.obj : error LNK2019: unresolved external symbol cvHaarDetectObjects referenced in function mexFunction 
me_HaarDetectOpenCV.mexw64 : fatal error LNK1120: 9 unresolved externals 
 
  D:\PROGRA~2\MATLAB\R2013A\BIN\MEX.PL: Error: Link of 'me_HaarDetectOpenCV.mexw64' failed. 
 
Error using mex (line 206)
Unable to complete successfully. 
>> 





如何修复错误并编译(创建me_HaarDetectOpenCV.mexw64)??



how fix error and compile (created me_HaarDetectOpenCV.mexw64)??

推荐答案

它在行中的样子:



-LC:\ openncv \ build \ x64 \vc11 \lib -IC:\ opencv\build\include\opencv -lcv -lcxcore me_HaarDetectOpenCV.cpp



是这是编译文件的编译执行行:'me_HaarDetectOpenCV.cpp '

,你试图让编译器知道库的位置:



-LC:\ openncv \ buildd \\ x64 \vc11 \lib但是没有特别指定库文件,



并且您正在尝试包含标题file(s):



'opencv'并且你想使用-lcv和-lcxcore选项。



编译器对此进行了不同的解释。编译器看到:



-IC:\ openncv \ build \ include \ openncv作为要附加和加载的库文件,

以及'cv'和'cxcore',并且看到-1或-l作为'cv'和'cxcore'的选项代码。



我的第一个问题是:在选项'-lcv'中,是连字符后面的字符( - )a one(1)或小写L(l ),如果他们不是'i'包括在内,或者它是'l'用于图书馆,还是'1'用于某些选项?



因此,在某种批处理文件中,单独的命令行可能看起来像下面这样:



-LC:\ openncv \ build \ x64 \ vc11 \lib cv.lib cxcore.lib libcxcore.lib

-IC:\ openncv \ build \ include.\\opencv -i cv.h -i cxcore.h -i libcxcore。 h $>


我真的不知道,只是一个猜测。
What it looks like in the line:

-LC:\opencv\build\x64\vc11\lib -IC:\opencv\build\include\opencv -lcv -lcxcore me_HaarDetectOpenCV.cpp

is that this is your compile execution line to compile the file: 'me_HaarDetectOpenCV.cpp'
and you are attempting to let the compiler know where the libraries are located:

-LC:\opencv\build\x64\vc11\lib but haven't specified a library file or files in particular,

and that you are attempting, in particular, to include the header file(s):

'opencv' and that you want to use the -lcv and -lcxcore options.

The compiler has interpreted this differently. The compiler saw:

"-IC:\opencv\build\include\opencv" as the library file that you wanted to attach and load,
as well as 'cv' and 'cxcore', and was seeing the -1 or the -l as the option code for 'cv' and 'cxcore'.

My first question is: in the option '-lcv', is the character after the hyphen(-) a one(1) or a lower case L(l), and should they not be 'i' for include, or is it 'l' for library, or is it '1' for some option number one?

So maybe separate command lines should have looked something like the below in a batch file of some kind:

-LC:\opencv\build\x64\vc11\lib cv.lib cxcore.lib libcxcore.lib
-IC:\opencv\build\include\opencv -i cv.h -i cxcore.h -i libcxcore.h

I don't really know, just a guess.


这篇关于编译错误(MEX无法找到库)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆