I'm trying to build a DLL using Visual Studio 12 Community that depends on OpenCV.
I want to include OpenCV as .lib files so I don't have to distribute it seperately, but I need my file to be built as a DLL.
But I can't configure Visual Studio to import a lib into a DLL. If in
My Project -> Properties -> Configuration Properties -> General -> Configuration Type,
I select "static library (.lib)" and in:
My Project -> Properties -> Configuration Properties -> VC++ Directories -> Library Directories,
I select the path to the OpenCV .lib files, and in
My Project -> Properties -> Configuration Properties -> Linker -> Addition Dependencies
I add a reference to each .lib, it works.
But if I change the Configuration Type do "dynamic library (.dll)", Visual studio tells me:
opencv_highgui2410d.lib(window.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in VectorsImport.obj
It seems I can only make .lib files with .lib files. But that seems very unlikely. I've looked this up, but I only find guides on how to make .lib files or .dll files or one out of the other. This must be pretty simple, but I can't figure it out. I'm used to Linux, where a .o can pretty easily be included into a .so . This puzzles me.