Ask Your Question

Revision history [back]

Problems including OpenCV 2.3.0 in Visual Studio 2008 with static libraries

Hello,

I am trying to build a project in Visual Studio 2008 (C++) (a DLL project) including OpenCV 2.3.0

For that, I added to the project folder the include files (headers) and the libraries .lib, that I found in the OpenCV installation folder, inside build->x86->vc9->lib. Everything works fine when I use these .lib in combination with the DLLs that come in the OpenCV folder inside build->x86->vc9->bin.

However, the problem comes when I try to use the static libraries than are in the folder build->x86->vc9->staticlib instead of the .lib that come in the folder "lib", in order to be able to remove the DLLs. When I try to compile with this configuration, I get a lot of compilation errors, for example:

*1> Creating library .\Debug/PI_Parameter.lib and object .\Debug/PI_Parameter.exp

1>opencv_core230d.lib(persistence.obj) : error LNK2019: unresolved external symbol _gzputs referenced in function "void __cdecl icvPuts(struct CvFileStorage *,char const *)" (?icvPuts@@YAXPAUCvFileStorage@@PBD@Z)

1>opencv_core230d.lib(persistence.obj) : error LNK2019: unresolved external symbol _gzclose referenced in function "void __cdecl icvClose(struct CvFileStorage *)" (?icvClose@@YAXPAUCvFileStorage@@@Z)

1>opencv_core230d.lib(persistence.obj) : error LNK2019: unresolved external symbol _gzopen referenced in function _cvOpenFileStorage*

I cannot figure out which is the problem.

Thank you for your help,

Dario