LNK2019: unresolved external symbol error in Visual Studio C++
opencv, visual-studio-2010
Solution
`'unresolved external symbol'` means that you're not linking with required library. Go to `Properties -> Linker -> Additional Library dependencies` and add path to OpenCV libs.
Problem
This is my code in Visual Studio C++ ``` #include "stdafx.h" #include<opencv\cv.h> #include<opencv\highgui.h> using namespace cv; int main(int argc, char** argv[]) { IplImage* img = cvLoadImage("logo.jpg"); cvNamedWindow("Test", CV_WINDOW_AUTOSIZE); cvShowImage("Test", img); cvWaitKey(0); cvReleaseImage(&img); cvDestroyWindow("Test"); return 0; } ``` I am using OpenCV 2.4.6 and Visual Studio 2010. This is the error: ``` openCV_testing.obj : error LNK2019: unresolved external symbol _cvDestroyWindow referenced in function _main openCV_testing.obj : error LNK2019: unresolved external symbol _cvReleaseImage referenced in function _main openCV_testing.obj : error LNK2019: unresolved external symbol _cvWaitKey referenced in function _main openCV_testing.obj : error LNK2019: unresolved external symbol _cvShowImage referenced in function _main openCV_testing.obj : error LNK2019: unresolved external symbol _cvNamedWindow referenced in function _main openCV_testing.obj : error LNK2019: unresolved external symbol _cvLoadImage referenced in function _main ``` Please help.