在发布模式下出错,但在构建模式下没有

Tem*_*mpo 3 c++ opencv visual-studio-2008 visual-c++

我最近在visual 2008中使用opencv和c ++创建了一个项目当我在调试模式下构建项目时 - 我没有遇到任何问题 - 但是当我在发布模式下构建它时,我得到以下错误:

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
Run Code Online (Sandbox Code Playgroud)

Jac*_*cob 11

检查Release配置中的Linker-> Input-> Additional Dependencies设置; 毫无疑问,你忘了包含OpenCV库.只需从Debug配置中复制粘贴它们,但不要忘记删除d后缀.

例如cv210.lib:发布模式和cv210d.lib:调试模式.