Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Building OpenCV 3.0.0 with MS Visual Studio 2012

I am trying to compile OpenCV 3.0.0 (code build with CMake) using Microsoft Visual Studio 2012. I am following the tutorial: http://docs.opencv.org/trunk/doc/tutorials/introduction/windows_install/windows_install.html. By following the tutorial, I can build the libraries without errors to the directory: C\OpenCV300\build\install (.dlls in the ...\bin\ directory and .lib files in the ...\lib\ directory). However, when I make a new project in Visual Studio and and try to use these libraries for reading/writing images and utilizing my webcam, I get errors, such as the following:

1>OpenCV300_Webcam.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl cv::VideoCapture::read(class cv::_OutputArray const &)" (?read@VideoCapture@cv@@UEAA_NAEBV_OutputArray@2@@Z)

1>OpenCV300_Webcam.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl cv::VideoCapture::isOpened(void)const " (?isOpened@VideoCapture@cv@@UEBA_NXZ)

1>OpenCV300_Webcam.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl cv::VideoCapture::~VideoCapture(void)" (??1VideoCapture@cv@@UEAA@XZ)

1>OpenCV300_Webcam.obj : error LNK2001: unresolved external symbol "public: __cdecl cv::VideoCapture::VideoCapture(int)" (??0VideoCapture@cv@@QEAA@H@Z)

which seem to indicate the libraries are not working correctly. Note that I also downloaded a pre-compiled version of OpenCV 2.4.9 and am able to utilize those just fine. Thus, I would guess I am doing something wrong that is causing the library files to not compile correctly (I am not an expert programmer, and this is the first time I've tried to build a large library like this from the source code).

click to hide/show revision 2
No.2 Revision

updated 2014-09-25 15:49:54 -0600

berak gravatar image

Building OpenCV 3.0.0 with MS Visual Studio 2012

I am trying to compile OpenCV 3.0.0 (code build with CMake) using Microsoft Visual Studio 2012. I am following the tutorial: http://docs.opencv.org/trunk/doc/tutorials/introduction/windows_install/windows_install.html. http://docs.opencv.org/trunk/doc/tutorials/introduction/windows_install/windows_install.html . By following the tutorial, I can build the libraries without errors to the directory: C\OpenCV300\build\install (.dlls in the ...\bin\ directory and .lib files in the ...\lib\ directory). However, when I make a new project in Visual Studio and and try to use these libraries for reading/writing images and utilizing my webcam, I get errors, such as the following:

1>OpenCV300_Webcam.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl cv::VideoCapture::read(class cv::_OutputArray const &)" (?read@VideoCapture@cv@@UEAA_NAEBV_OutputArray@2@@Z)

1>OpenCV300_Webcam.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl cv::VideoCapture::isOpened(void)const " (?isOpened@VideoCapture@cv@@UEBA_NXZ)

1>OpenCV300_Webcam.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl cv::VideoCapture::~VideoCapture(void)" (??1VideoCapture@cv@@UEAA@XZ)

1>OpenCV300_Webcam.obj : error LNK2001: unresolved external symbol "public: __cdecl cv::VideoCapture::VideoCapture(int)" (??0VideoCapture@cv@@QEAA@H@Z)

which seem to indicate the libraries are not working correctly. Note that I also downloaded a pre-compiled version of OpenCV 2.4.9 and am able to utilize those just fine. Thus, I would guess I am doing something wrong that is causing the library files to not compile correctly (I am not an expert programmer, and this is the first time I've tried to build a large library like this from the source code).