[Solved] Linker error while building WITH_QT [closed]

asked 2015-05-08 13:20:00 -0500

viktor gravatar image

updated 2015-05-08 20:41:03 -0500

Hi folks,

I'm currently trying to build revision a31b29308f with the WITH_QT CMake flag on a Windows 7 x64 machine.

I use Microsoft Visual Studio 2012 (VS11) compiler and the qt-opensource-windows-x86-msvc2012_opengl-5.4.1 package. The QT install folder is added to the path. Once I generate the cmake files i recieve a couple of 'Policy CMP0020 not set' warnings. So far so good (I've pasted the cmake log at http://pastebin.com/3kFAhzns). When I move onto building OpenCV I start to receive linker errors that look like this:

LINK : fatal error LNK1104: cannot open file '..\..\lib\Debug\opencv_highgui300d.lib'
(I've pasted the entire log here: http://pastebin.com/PL3wq6EN)

No wonder, when the error occurs, there's no such *.lib file present!
But when I don't use the WITH_QT flag, everything works fine.
Any suggestions why?

Many thanks, best regards,
Viktor

Edit:
Building Qt from source instead of using pre-build x86 ones resolved the issue.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by StevenPuttemans
close date 2015-05-09 06:22:02.168568

Comments

1

look at line 832 of your pastebin. you're building for x64 but linking x86 qt libs.

(opencv_highgui300d.lib was not built because of this)

berak gravatar imageberak ( 2015-05-08 13:28:40 -0500 )edit
2

Darn it, must have missed that one.. Building Qt libs from source solved the issue. Many thanks for your help, berak!

viktor gravatar imageviktor ( 2015-05-08 20:39:00 -0500 )edit