尝试使用visual studio编译OpenCv文件时出现链接器错误

时间:2011-08-22 19:06:12

标签: visual-studio opencv linker

我尝试编译一些OpenCv函数,并从目录C:\ OpenCV2.2 \ modules \ haartraining中包含了cvhaartraining.h。

我把项目> '您的项目名称'属性...>配置属性>链接器>输入>

opencv库中的所有.lib文件:

"C:\OpenCV2.2\lib\opencv_highgui220d.lib" "C:\OpenCV2.2\lib\opencv_core220d.lib" "C:\OpenCV2.2\lib\opencv_ml220d.lib" "C:\OpenCV2.2\lib\opencv_video220d.lib" "C:\OpenCV2.2\lib\opencv_legacy220d.lib" "C:\OpenCV2.2\lib\opencv_imgproc220d.lib" "C:\OpenCV2.2\lib\opencv_objdetect220d.lib" "C:\OpenCV2.2\lib\opencv_ts220.lib" "C:\OpenCV2.2\lib\opencv_calib3d220d.lib" "C:\OpenCV2.2\lib\opencv_contrib220d.lib" "C:\OpenCV2.2\lib\opencv_features2d220d.lib"
 "C:\OpenCV2.2\lib\opencv_ffmpeg220d.lib" "C:\OpenCV2.2\lib\opencv_flann220d.lib" "C:\OpenCV2.2\lib\opencv_gpu220d.lib"

但它仍然无法链接。

我得到的错误是:

vecToFiles.obj : error LNK2019: unresolved external symbol "void __cdecl cvShowVecSamples(char const *,int,int,double)" (?cvShowVecSamples@@YAXPBDHHN@Z) referenced in function _main
vecToFiles.obj : error LNK2019: unresolved external symbol "int __cdecl cvCreateTrainingSamplesFromInfo(char const *,char const *,int,int,int,int)" (?cvCreateTrainingSamplesFromInfo@@YAHPBD0HHHH@Z) referenced in function _main
vecToFiles.obj : error LNK2019: unresolved external symbol "void __cdecl cvCreateTestSamples(char const *,char const *,int,int,char const *,int,int,int,double,double,double,int,int,int)" (?cvCreateTestSamples@@YAXPBD0HH0HHHNNNHHH@Z) referenced in function _main
vecToFiles.obj : error LNK2019: unresolved external symbol "void __cdecl cvCreateTrainingSamples(char const *,char const *,int,int,char const *,int,int,int,double,double,double,int,int,int)" (?cvCreateTrainingSamples@@YAXPBD0HH0HHHNNNHHH@Z) referenced in function _main
vecToFiles\Debug\vecToFiles.exe : fatal error LNK1120: 4 unresolved externals

我想我错过了一些.lib文件,但我不知道哪个文件。 我很感激任何帮助。

1 个答案:

答案 0 :(得分:0)

你有什么额外的lib文件?从谷歌搜索看起来它被编译成一个名为cvhaartraining.lib的文件。