I wrote some simple routines using opencv 2.4.4 and i had no problems to run the code. The development environment is MS Visual Studio 2010.
My original aim is to build a 64bit dll file which I can use from IDL (interactive data language). Building simple dlls WITHOUT the opencv stuff works well and I can call these functions from IDL. By using opencv classes the build succeeds without any problems. But when I try to use the dll I get an error:
"Not a valid WIN32 application".
So what I did is to check all properties of my project, especially:
Configuration Properties:
Configuration Type: Dynamic Library (.dll)
Use of MFC: Use MFC in a Static Library
C/C++:
Preprocessor: added WIN64
Code Generation: Multi threaded (/MT)
dumpbin tells me that everything is ok with my dll...
The only thing I realized with dumpbin /dependents is, that there is still an external dependency to opencv_core244.dll (and others if I use the full code). So linking to a static dll seems not to work?
After building opencv as a static library I can build my dll.
BUT: The external dependency to opencv_core244.dll still remains and I cannot use it from IDL...
Is there any linker option I forgot to set?
These errors comes from zlib library, which OpenCV uses internally. You need to link against zlib too.
After correct building OpenCV statically there should be no depedency on any OpenCV DLLs, are you sure you feed newer opencv .lib files to linker input ??? It should be huge in size.
Didn't knew that I have to add the opencv projects that I use in my functions to the solution. After adding these and defining the dependencies in the property page everything works.
Thanks!