Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

unresolved externals after custom build (vs14)

The newest OpenCV comes prebuilt only as 64-bit. I have started with a working MSVS2010/OpenCV 3 rc1 project (32-bit). I am upgrading to VS2015/OpenCV 3.1.0 (32-bit).

I successfully built the OpenCV shared libraries using CMake and the vs14 toolkit. So far, so good.

Back in my project, I have added the libraries, and they are presumably found. I have even tried to ensure that they are loaded with #pragma in a respective cpp file (to no different effect):

pragma comment(lib, "opencv_core310d.lib") ...

I get unresolved externals in many of those respective files. For example:

error LNK2019: unresolved external symbol "int __cdecl cv::operator-(class cv::MatConstIterator const &,class cv::MatConstIterator const &)"
error LNK2001: unresolved external symbol "public: virtual class cv::Mat __thiscall cv::_InputArray::getMat(int)const "
error LNK2001: unresolved external symbol "public: __thiscall cv::Exception::Exception...

With my build of opencv, I can create a new project, add the apparently same configuration (done with using the same property sheet), and e.g. construct a cv::Exception. I am adding core, and imgproc among a few others.

The linker reports just 39 of those unique unresolved symbols in a sizable project (duplicated for 294 total errors). If I do remove my configuration properties for OpenCV, the number of unresolved symbols jumps to 82 (for 712 errors).

I'm at a loss to why this is happening - what is the problem here?

unresolved externals after custom build (vs14)

The newest OpenCV comes prebuilt only as 64-bit. I have started with a working MSVS2010/OpenCV 3 rc1 project (32-bit). I am upgrading to VS2015/OpenCV 3.1.0 (32-bit).

I successfully built the OpenCV shared libraries using CMake and the vs14 toolkit. So far, so good.

Back in my project, I have added the libraries, and they are presumably found. I have even tried to ensure that they are loaded with #pragma in a respective cpp file (to no different effect):

pragma comment(lib, "opencv_core310d.lib") ...

I get unresolved externals in many of those respective files. For example:

error LNK2019: unresolved external symbol "int __cdecl cv::operator-(class cv::MatConstIterator const &,class cv::MatConstIterator const &)"
error LNK2001: unresolved external symbol "public: virtual class cv::Mat __thiscall cv::_InputArray::getMat(int)const "
error LNK2001: unresolved external symbol "public: __thiscall cv::Exception::Exception...

With my build of opencv, I can create a new project, add the apparently same configuration (done with using importing the same property sheet), sheet I made for OpenCV dependencies), and e.g. construct a cv::Exception. That results in no errors. I am adding core, and imgproc among a few others.

The linker reports just 39 of those unique unresolved symbols in a sizable project (duplicated for 294 total errors). If I do remove my configuration properties for OpenCV, the number of unresolved symbols jumps to 82 (for 712 errors).

I'm at a loss to why this is happening - what is the problem here?