unresolved external symbol error when importing libraries for OpenCV2.3 in Visual Studios 2010 Express C++

孤街醉人 提交于 2019-11-27 04:42:06

If you DID explicitly set up linking with all the necessary libraries, but linking errors still show, you might be mixing up 64/32 bit libraries and application.

I.e. make sure that all library includes point to 32 bit version of libraries if you are building 32 bit application.

I had a similar problem while I was trying to compile cvblob library (http://code.google.com/p/cvblob/) on Windows 7 32bit with Visual Studio 2010.

If everything else is done properly try my guess written below. If not start with these tutorials:

Errors I got were:

Error 24 error LNK2019: unresolved external symbol _cvSetImageROI referenced in function _cvSetImageROItoBlob C:\cvblob\build\lib\cvblob.obj cvblob

Error 25 error LNK2019: unresolved external symbol _cvSaveImage referenced in function _cvSaveImageBlob C:\cvblob\build\lib\cvblob.obj cvblob

Error 26 error LNK2019: unresolved external symbol _cvGetImageROI referenced in function _cvSaveImageBlob C:\cvblob\build\lib\cvblob.obj cvblob

Error 27 error LNK2001: unresolved external symbol _cvError C:\cvblob\build\lib\cvcolor.obj cvblob

Error 28 error LNK2019: unresolved external symbol _cvError referenced in function _cvRenderBlob C:\cvblob\build\lib\cvblob.obj cvblob

Error 29 error LNK2001: unresolved external symbol _cvError C:\cvblob\build\lib\cvlabel.obj cvblob

Error 30 error LNK2001: unresolved external symbol _cvError C:\cvblob\build\lib\cvcontour.obj cvblob

Error 31 error LNK2001: unresolved external symbol _cvError C:\cvblob\build\lib\cvtrack.obj cvblob

Error 32 error LNK2019: unresolved external symbol _cvLine referenced in function _cvRenderBlob C:\cvblob\build\lib\cvblob.obj cvblob

Error 33 error LNK2001: unresolved external symbol _cvLine C:\cvblob\build\lib\cvcontour.obj cvblob

Error 34 error LNK2019: unresolved external symbol _cvRectangle referenced in function _cvRenderBlob C:\cvblob\build\lib\cvblob.obj cvblob

Error 35 error LNK2001: unresolved external symbol _cvRectangle C:\cvblob\build\lib\cvtrack.obj cvblob

Error 36 error LNK2019: unresolved external symbol _cvSetZero referenced in function _cvLabel C:\cvblob\build\lib\cvlabel.obj cvblob

Error 37 error LNK2019: unresolved external symbol _cvPutText referenced in function _cvRenderTracks C:\cvblob\build\lib\cvtrack.obj cvblob

Error 38 error LNK2019: unresolved external symbol _cvInitFont referenced in function _cvRenderTracks C:\cvblob\build\lib\cvtrack.obj cvblob

Error 39 error LNK1120: 9 unresolved externals C:\cvblob\build\lib\libs\Release\cvblob.dll cvblob

I hope it will help someone compiling cvblob library in visual studio 2010.

I had similar problem in vs10 and i have forgot to add the cv210d.lib. Adding that to project properties->configuration properties-> Linker->Input->Aditional Dependencies helped me in solving this issue. I found from the question that opencv_cv230.lib was not included in additional dependencies adding that will help solving the issue.

I Had The Same Problem, in vs10

i've missed the "opencv_core246d.lib" to add. adding it to Linker->Input->Aditional Dependencies fixed error.

Cloud Guy

This might help with the newer version.
For version 2.4.8, adding opencv_imgproc248.lib resolves the following linking error:

error LNK2019: unresolved external symbol _cvRemap referenced in function _main
error LNK2019: unresolved external symbol _cvInitUndistortMap referenced in function _main
error LNK2019: unresolved external symbol _cvFindCornerSubPix referenced in function _main
error LNK2019: unresolved external symbol _cvCvtColor referenced in function _main

for me, this error got resolved by adding two lib name explicitly under input (configuration properties-->linker-->input-->additional dependencies).

when you install opencv , based on version it will have a number appended to it. For example I have opencv2.4.13 and it has 2413 appended to all its libraries, opencv_highgui2413.lib (opencv_highgui2413d.lib for debug build ).

Now,check which libraries have the functions that were shown in errors. highgui has cvshowimage function --> you can get this by searing it online. http://docs.opencv.org/2.4/modules/highgui/doc/user_interface.html

Then add that lib to input and build your solution.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!