Error in Release mode but not in Build mode
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: unres开发者_高级运维olved 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
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.
E.g. cv210.lib
: Release mode and cv210d.lib
: Debug mode.
You are not including the same libraries in your release build that you include in your debug build. "unresolved external symbol" means it cannot find the implementation for a function you are referencing.
This happens when you give Additional Dependencies to Debug mode but not in Release.
精彩评论