I'm trying to set up OpenCV 2.4 as follows:
C:\OpenCV240
.C:\OpenCV240\build\include
as an additional include directory.C:\OpenCV240\build\x86\vc10\staticlib
as an additional library directory.When I compile my "Hello World" program (which compiles just fine when using the DLLs), I get a lot error messages like this:
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: __thiscall std::_Container_base12::~_Container_base12(void)" (??1_Container_base12@std@@QAE@XZ) already defined in opencv_core240d.lib(matrix.obj)
What am I doing wrong?
It sounds like you need to specify linking against the static C runtime library in your program.
If OpenCV linked against the static CRT and you use the dynamic one, you get these types of redefinition errors.
To change this setting, open your project's Properties and go to Configuration Properties -> C/C++ -> Code Generation
.
Change Runtime Library
from Multi-threaded Debug DLL (/MDd)
to Multi-threaded Debug (/MTd)
. Do the same for your other configurations, using the non-Debug variant where appropriate.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With