Unsolved Error while building Qt 5.7 on Windows
-
@amura.cxg How did you call configure? It looks like you're trying to build with MS C++ compiler, but you write that you downloaded MinGW.
-
I called configure with the following:
configure -debug -nomake examples -opensource -platform win32-g++
I've been (mostly) following this guide. If you're curious this is what I have in my qt5vars.cmd file:
@ECHO off SET _QT_SRC=D:\Dev\Qt\5.6\Src SET _MINGW=D:\Dev\Qt\5.6\mingw49_32 SET _JOM=D:\Dev\Jom REM Add the MinGW bin directory to the path SET PATH=%_MINGW%\bin;%PATH% REM Add the QT directories to the path SET PATH=%_QT_SRC%\qtbase\bin;%_QT_SRC%\gnuwin32\bin;%PATH% REM Add the Jom directory to the path SET PATH=%_JOM%;%PATH% REM SET QMAKESPEC=win32-msvc2013 CD %_QT_SRC% SET _QT_SRC= SET _MINGW= SET _JOM=
-
So out of curiosity I decided to try running the configure command on version 5.5 and I didn't get any errors. So maybe there are is something up with 5.6 and 5.7 in Windows?
-
Hi,
Since you want to build for Visual Studio 2013, why are you setting up your environment to build with MinGW ?
-
Sorry, should have specified. I do want to build with MinGW
-
Then why are you setting
QMAKESPEC
to Visual Studio 2013 ? -
@SGaist
That's a comment in the M$ language (starts withREM
) ... :) -
@kshegunov I didn't pay attention to that one. Good catch.
-
Did you install mingw with Qt's maintenance tool? If so, then in your start menu you will have a shortcut for the
Qt (MinGW)
command prompt. Start it and in the root dir just issueconfigure ...
and thenmingw32-make
.PS.
There's nojom
withmingw
,jom
is a fix for MS'snmake
. -
This post is deleted! -
@kshegunov I did indeed, I gave that a try and it worked perfectly. I managed to configure and make with no problems. I really appreciate your help!
I do have another question regarding cross compiling. Some context first; my ultimate goal is to cross compile Qt for my Raspberry Pi and setup a kit in Qt Creator so I can develop in the creator on my Windows PC and then push the cross compiled code to the Pi. I've been reading through a couple guides (first, second) and in the first guide it says to configure without the
-device-option CROSS_COMPILE
option to build qmake (Steps 12-14) then to configure and make with the-device-option CROSS_COMPILE
option. However the second guide doesn't do this but this second guide is for building on Linux.My question is: Do I need to configure without the cross compile option then do it again with it? Or am I safe to just configure and make once with the option?
Again, I really appreciate the help so far. I'm a bit of a noob and once I get everything working I'm hoping to write up a guide as I found there wasn't one that achieved the same thing I'm trying.
-
I did indeed, I gave that a try and it worked perfectly. I managed to configure and make with no problems.
I'm glad. The Qt (mingw) command prompt will just call all the needed initialization scripts to set your build environment up.
My question is: Do I need to configure without the cross compile option then do it again with it? Or am I safe to just configure and make once with the option?
+1 for the description, but I really can't say. I've never in my life cross-compiled anything, much less Qt. I would guess that you need to cross compile
qmake
only if you intend on running it on the embedded device, but again, I'm just speculating here.Kind regards.
-
If I may, it would be way easier to do the cross-compiler stuff from a Linux virtual machine. It simplifies things a lot.
-
@SGaist Haha yeah I was starting to feel that was the case. Probably a dumb question, but if I cross compile Qt on Linux will I still be able to develop on my Windows (assuming I have the right cross compiler)? Is the cross compiling step only to get Qt onto my device?
-
The cross-compiling part is to build the libraries for your device but also to give you a SDK that you can use on your computer to build the application. So technically, you still need to cross-compile Qt from Windows if you want to cross-compile the application there for your target. Otherwise you can also develop on Windows and only fire-up your Linux machine when you want to build/run for your target.
In any case, Qt Creator is available for both OSs so you won't have too much trouble to develop directly on Linux.
-
@SGaist ok that makes sense, thanks! I'm going to give cross compiling on Windows a couple more tries, I want to see if it's possible mostly because there seems to be a bit of a lack of information around it so if I could help fill that in that would hopefully help someone in the future. Though I suspect I'll be developing in Linux soon haha
Thanks for all the information, with the help I've got from here I've learned a lot