SOLVED anybody writing with Qt 5.3 using OpenCV3 on Windows 7 64 bit machine
-
Looks like you are trying to build a static debug version while using object build for a dynamic debug version.
You should build different version in different folders. However to start, just build dynamic versions. Using the static Visual Studio runtime is not recommended.
The cmake gui may have been built with that version of Qt which is not the same as the one your project will use like e.g. Qt Creator is built with one version of Qt and one compiler but it's completely independent of the Qt versions you'll be using to develop your application.
If you want to check the parameter that will be used to build e.g. OpenCV, run ccmake in the folder where you configured your build.
-
SGaist,
I really appreciate your help here!!!
Unfortunately, I'm just not grasping your first sentence. I'm pretty sure I understand what you mean by a static debug version and a dynamic debug version, I just don't understand what is needed to be done to change them.I'm apparently still to new to all this to understand relationships between the different Qt's, CMake's, and MSVC. I downloaded the Qt 5.3.2 binaries, and loaded them. I have used the program for a few months and all works fine as far as I know. I downloaded MS Visual Studio 2013 Express binaries from Microsoft and they worked also. Same with CMake. Not sure I understand why they will not set up OpenCV to work with Qt.
Bob -
One other thing...I read your first response again. I picked the MSVC 2013 64 bit compiler. I think I understand the library differences you referred too, e.g. opencv_core249d.lib is for DEBUG and opencv_249.lib is for RELEASE, correct? Is one considered static and the other dynamic, or am I totally out in the woods?
-
lib files are tricky on windows, they can either be import libraries or static libraries, generally their size is a good indicator of which type they are.
Microsoft also proposes two possible runtimes: static and dynamic. Now the fun part: you can build a static lib/app that links to the dynamic runtime or a dynamic library/application against the static runtime.
The thing is, you have to select one or the other runtime and link all your components to the same version. The recommended runtime is the dynamic.
-
Once again, I TRULY APPRECIATE YOUR HELP AND ADVISE!!
However, I'm at my wits end trying to simply get OpenCV to work with a short Qt Wiget project. I spent the last week reading the documentation here, QT and OpenCV books, watching Youtube videos...all without luck. I loaded both PRE-COMPILED programs and can not get then to work together. I tried the source programs and had even more problems.
This seems to be a whole lot more trouble than it's worth! However, as I've never been a quiter, I'll give it one more week.
Thanks again!
-
Ok, I have gone from 4500+ errors down to 135. Here are the first five. They all are similar. Can't figure these out! Any guidance??
Error 1 error LNK2019: unresolved external symbol gzputs referenced in function "void __cdecl icvPuts(struct CvFileStorage *,char const *)" (?icvPuts@@YAXPEAUCvFileStorage@@PEBD@Z) D:\AllProgrammingProjs\C++Stuff\MyNewOpenCV\MyNewOpenCV\opencv_core249d.lib(persistence.obj) MyNewOpenCV
Error 2 error LNK2019: unresolved external symbol gzgets referenced in function "char * __cdecl icvGets(struct CvFileStorage *,char *,int)" (?icvGets@@YAPEADPEAUCvFileStorage@@PEADH@Z) D:\AllProgrammingProjs\C++Stuff\MyNewOpenCV\MyNewOpenCV\opencv_core249d.lib(persistence.obj) MyNewOpenCV
Error 3 error LNK2019: unresolved external symbol gzrewind referenced in function "void __cdecl icvRewind(struct CvFileStorage *)" (?icvRewind@@YAXPEAUCvFileStorage@@@Z) D:\AllProgrammingProjs\C++Stuff\MyNewOpenCV\MyNewOpenCV\opencv_core249d.lib(persistence.obj) MyNewOpenCV
Error 4 error LNK2019: unresolved external symbol gzeof referenced in function "int __cdecl icvEof(struct CvFileStorage *)" (?icvEof@@YAHPEAUCvFileStorage@@@Z) D:\AllProgrammingProjs\C++Stuff\MyNewOpenCV\MyNewOpenCV\opencv_core249d.lib(persistence.obj) MyNewOpenCV
Error 5 error LNK2019: unresolved external symbol gzclose referenced in function "void __cdecl icvCloseFile(struct CvFileStorage *)" (?icvCloseFile@@YAXPEAUCvFileStorage@@@Z) D:\AllProgrammingProjs\C++Stuff\MyNewOpenCV\MyNewOpenCV\opencv_core249d.lib(persistence.obj) MyNewOpenCV -
What do you mean by that ?
The missing symbols comes from zlib
-
"What do you mean by that?" I assume you mean my comment about..."This was an error. double tapped the enter key. sorry!"... I pushed enter twice and it logged my comment twice. I deleted the comment and left that message./
Please explain how you think I can fix the errors with your comment...
"The missing symbols comes from zlib"
I'm totally lost here!!
Bob
-
Do you have a zlib.lib file in OpenCV somewhere ?
-
Good evening!
Yes I have zlib.lib in the following OpenCV2.4.9 (which is the one I am now trying to use).C:\OpenCV249\build\x86\vc12\staticlib
C:\OpenCV249\build\x86\vc11\staticlib
C:\OpenCV249\build\x86\vc10\staticlib
C:\OpenCV249\build\x64\vc12\staticlib
C:\OpenCV249\build\x64\vc11\staticlib
C:\OpenCV249\build\x64\vc10\staticlibI have been trying to use the path for the x64\vc12 and have substituted the last folded with \staticlib, \lib & \bin, individually of course. None seemed to correct the errors.
-
Found a minor typo in the PROPERTY PAGE in Visual C++. That caused the coding to NOT find the proper PATH.
However, I will still keep studying the difference, and proper coding, for Static and Dynamic Libraries!!
Thanks again for the assistance and help!!
Bob
-
One important point if you want to go static with Qt, you'll need a commercial license.
The advantage of static linking is that you don't need to deploy dlls with your application but at the cost of the size of the application. You also don't have the choice when updating, you have to rebuild everything.
The dynamic linking allows you to switch libraries easily if you need e.g. a more recent version of one of your dependencies (the binary compatibility must still be checked, but that's another point)
-
AFAIK no, licensing itself doesn't matter
-
Well, that's NOT good news! That means I have another problem!!
See: