用mexmatlab调用mexcpp,为什么出现没有cv.h文件

1 accepted answer
Reputation: 0
Compile Error ( MEX could not find the library )
1 accepted answer
Reputation: 0
Latest activity
7,557 accepted answers
Reputation: 39,254
on 16 Dec 2013
1 accepted answer
Reputation: 0
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:
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.
how fix error and compile (created me_HaarDetectOpenCV.mexw64)??
7,557 accepted answers
Reputation: 39,254
1 accepted answer
Reputation: 0
No products are associated with this question.
1 accepted answer
Reputation: 0
Direct link to this answer:
1 accepted answer
Reputation: 0
&Accepted answer
i'm using code to the created the MEX file (me_HaarDetectOpenCV.mexw64)mex -largeArrayDims -I'C:\opencv\build\include' -L'C:\opencv\build\x64\vc11\lib\realese'
-lopencv_core247 -lopencv_imgproc247 -lopencv_objdetect247 me_HaarDetectOpenCV.cpp
7,557 accepted answers
Reputation: 39,254
7,557 accepted answers
Reputation: 39,254
Direct link to this answer:
7,557 accepted answers
Reputation: 39,254
You do not have the cv library that it needs to link against, or else you have the library in a different directory.Perhaps you downloaded opencv but did not tell it to compile itself.
1 accepted answer
Reputation: 0
MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test
Discover what MATLAB& can do for your career.
Opportunities for recent engineering grads.
MATLAB Academy
New to MATLAB?
Select Your Country
Choose your country to get translated content where available and see local events and offers. Based on your location, we recommend you select United States from the following list:
(Fran?ais)
(Italiano)
Switzerland
Asia Pacific
(简体中文)使用matlab进行mex编译时的路径问题mexopts_Linux编程_Linux公社-Linux系统门户网站
你好,游客
使用matlab进行mex编译时的路径问题mexopts
来源:Linux社区&
作者:FocusYang55
matlab和vs 进行混合编程时总需要使用matlab编译mexFunction.cpp文件。这些文件免不了使用include下的*.h和lib下的*.lib文件。举例说明,这次我的cpp中用到了opencv/cv.h。在matlab\bin\win64\mexopts文件夹下有一个msvsopts100.bat的批处理文件。
用notepad 将这个文件打开在&include=& 和 &lib=& 后面添加需要使用的路径并加分号&;&
设置好之后保存。然后在matlab 中 输入mex mexFunction.cpp。但是还是会出现 cannot open file &opencv/cv.h&。这是为什么呢?
仔细观察发现mscvopts100.bat 中第6行中有这样一句话rem C++keyName: Microsoft Visual C++ 2010。这句话证明mscvopts100.bat ,在mex -setup的过程中修改过。因此可以猜测需要再次进行mex -setup 才能使这些路径生效。经过试验,确实如此。困扰了我两周。希望能给大家省时间。
Matlab与C/C++联合编程之从Matlab调用C/C++代码
二分类SVM方法Matlab实现
Matlab中的取整函数fix, floor, ceil与round
Matlab编译cuda的.cu文件
本文永久更新链接地址:
相关资讯 & & &
& (02月09日)
& (12/22/:27)
& (11月13日)
& (01月18日)
& (11/08/:08)
图片资讯 & & &
   同意评论声明
   发表
尊重网上道德,遵守中华人民共和国的各项有关法律法规
承担一切因您的行为而直接或间接导致的民事或刑事法律责任
本站管理人员有权保留或删除其管辖留言中的任意内容
本站有权在网站内转载或引用您的评论
参与本评论即表明您已经阅读并接受上述条款

我要回帖

更多关于 mex cpp 的文章

 

随机推荐