在发布模式下出现错误,但在构建模式下却没有 [英] Error in Release mode but not in Build mode
问题描述
我最近在Visual 2008中使用opencv和c ++创建了一个项目 当我以Debug模式构建项目时-我没有遇到任何问题-但是当我以发布模式构建项目时,出现以下错误:
I recently made a project using opencv and c++ in visual 2008 When i build the project in Debug mode - i don't face any issues - but when i build it in release mode i get the following errors:
1>test.obj : error LNK2001: unresolved external symbol _cvHaarDetectObjects
1>test.obj : error LNK2001: unresolved external symbol _cvCvtColor
1>test.obj : error LNK2001: unresolved external symbol _cvCreateImage
1>test.obj : error LNK2001: unresolved external symbol _cvDestroyWindow
1>test.obj : error LNK2001: unresolved external symbol _cvWaitKey
1>test.obj : error LNK2001: unresolved external symbol _cvGetSize
1>test.obj : error LNK2001: unresolved external symbol _cvReleaseCapture
1>test.obj : error LNK2001: unresolved external symbol _cvCreateMemStorage
1>test.obj : error LNK2001: unresolved external symbol _cvClone
1>test.obj : error LNK2001: unresolved external symbol _cvNamedWindow
1>test.obj : error LNK2001: unresolved external symbol _cvQueryFrame
1>test.obj : error LNK2001: unresolved external symbol _cvLoad
1>test.obj : error LNK2001: unresolved external symbol _cvRectangle
1>test.obj : error LNK2001: unresolved external symbol _cvCreateCameraCapture
1>test.obj : error LNK2001: unresolved external symbol _cvGetSeqElem
1>test.obj : error LNK2001: unresolved external symbol _cvShowImage
推荐答案
在Release配置中检查Linker-> Input-> Additional Dependencies设置;您无疑忘记了包含OpenCV库.只需从Debug配置中复制粘贴它们,但不要忘记删除d
后缀.
Check Linker->Input->Additional Dependencies settings in the Release configuration ; you have undoubtedly forgotten to include the OpenCV libraries. Just copy-paste them from the Debug configuration, but don't forget to remove the d
suffix.
例如cv210.lib
:发布模式,而cv210d.lib
:调试模式.
E.g. cv210.lib
: Release mode and cv210d.lib
: Debug mode.
这篇关于在发布模式下出现错误,但在构建模式下却没有的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!