Qt 4 Windows Installation Tutorial
Well I wasn't sure where to post this, but to help some of those guys that struggle out there, I made a small tutorial about the different methods of using and installing Qt.
Installing Qt 4.3.3 Windows
If you don't like it, please tell me why, and tell me how I can improve it to suite your needs or if I'm missing information please tell me.
If someone wants to elaborate more on the MSVC method please tell me :).
Thanks for your time.
Re: Qt 4 Windows Installation Tutorial
Quote:
You will need to buy the commercial version of Qt, or find a place to download the MSVC project for it, usually denoted by .vcproj or .sln. After that it is not difficult to set up.
This is no longer true.
I don't like the idea of changing QMAKE_LFLAGS for static linking. If you compile statically it should no longer be needed, Qt/QMake should take care of it by itself.
I would also reconsider using the %QTDIR% variable. If someone has Qt3 installed, it already has QTDIR defined and pointing to the Qt3 installation dir.
Re: Qt 4 Windows Installation Tutorial
Hmm that might explain why I am getting a crash in app.exec() lately.
Re: Qt 4 Windows Installation Tutorial
wysota, when I compile without doing the "configure -static -release -no-exception" and "mingw32-make sub-src" it gives me like a
"ld has returned 1" or something, and makes compiler errors.
If I do do it, it seems my program runs but disappears as soon as it hits app.exec() or crashes.
Re: Qt 4 Windows Installation Tutorial
You have to run configure before compilation. But you shouldn't change the specs manually. It's probably not exec that crashes but your code which is called from exec.
Re: Qt 4 Windows Installation Tutorial
What do you mean i have to configure and build all of Qt each time I compile? That makes no sense?
I am doing qmake make, and its compiling, but program disappears even though I have a .show() of a mainwindow.
Now I'm getting an error like:
Entering
Nothing to be done for 'first'
Leaving
and thats it, no compilation.
Damn now I cant compile at all, whats going on. All I did was "configure -platform win32-g++" and "mingw32-make" and thats it...
Re: Qt 4 Windows Installation Tutorial
Quote:
Originally Posted by
Arsenic
What do you mean i have to configure and build all of Qt each time I compile? That makes no sense?
I was referring to "when I compile without doing the ..." part of your post.
Quote:
Now I'm getting an error like:
Entering
Nothing to be done for 'first'
Leaving
and thats it, no compilation.
Because nothing changed in the code, so nothing gets compiled.
Quote:
Damn now I cant compile at all, whats going on. All I did was "configure -platform win32-g++" and "mingw32-make" and thats it...
Are we talking about compilation of Qt or your application? Because I'm getting lost here...
Re: Qt 4 Windows Installation Tutorial
Ok you're right, how silly of me, I didn't realize I didn't change the code.
Here's the error I get right now (no compiling of Qt, its set at my last config i posted):
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\ mingw32\bin\ld.exe: cannot fin
d -lQtGuid
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\PSN.exe] Error 1
mingw32-make[1]: Leaving directory `D:/_SoftDev/PSN'
mingw32-make: *** [debug] Error 2
My pro file:
Code:
TEMPLATE = app
TARGET =
CONFIG += static
DEPENDPATH += .
INCLUDEPATH += .
Re: Qt 4 Windows Installation Tutorial
Re: Qt 4 Windows Installation Tutorial
how can I build the debug libraries, I thought they were automatically built.
Using release inside config of my pro file, only caused 20 linker errors dealing with qt_main and cant linking "memset"...
Gonna try building qmake with "configure -platform win32-g++ -debug"
Alright perfect, thanks again wysota.
Re: Qt 4 Windows Installation Tutorial
Quote:
Originally Posted by
Arsenic
how can I build the debug libraries, I thought they were automatically built.
Follow the link in the FAQ I gave you or take a look at other entries there.
Quote:
Using release inside config of my pro file, only caused 20 linker errors dealing with qt_main and cant linking "memset"...
Sorry :)
Re: Qt 4 Windows Installation Tutorial
Hey wysota, there seems to be a problem.
Here's what I noticed, after I simply made a fresh install of Qt 4.3.3, and made sure it works fine, I added the CONFIG += static
into my pro file.
However, it is still not compiling the QtGui4.dll, QtCore4.dll and mingw10.dll into my program, because my program is still 19 KB.
Re: Qt 4 Windows Installation Tutorial
You need to compile Qt in static mode first. Then you can link your app against the previously compiled static Qt libraries. If you want mingw runtime compiled into the application, you need its static version too (if there is one) and have it before compiling Qt so that it links against the static and not the dynamic archive. You can't static link with dynamic libraries - these are completely different concepts. If you want to be able to do both static and dynamic linkage (for different programs), you need to have both the static and dynamic sets of Qt libraries installed.