PDA

View Full Version : Installing Qt 4.4 for Morons?



chris062689
9th October 2008, 07:40
I sware I've tried every guide I can find on how to install Qt 4.4 OpenSource.
I just simply can't figure out how to properly install it!

Does anyone have a "tried and true" method for installing Qt 4.4 (+ Eclipse / Visual Studio 2003, whichever's fine.) on Windows XP SP3? Could you walk me through it please? :crying:

I've been looking at Qt, and it seems like a really powerful framework, I just can't get it to install... :rolleyes:

I'm going to try this guide...
http://wiki.qtcentre.org/index.php?title=Qt4_with_Visual_Studio#A_Simple_Pr oject

wysota
9th October 2008, 08:47
The easiest thing to do is to download the version for MinGW that has an installer and run it. Afterwards you are immediately ready to go. If you want to integrate your installation with some IDE, install the Eclipse integration. Note that this is optional, the framework will work without Eclipse - you can even use notepad to develop your applications.

chris062689
9th October 2008, 09:54
Well, following that guide I'm stuck at the configure part.




Setting environment for using Microsoft Visual Studio 2008 x86 tools.

C:\Program Files\Microsoft Visual Studio 9.0\VC>cd C:\qt

C:\qt>configure

This is the Qt for Windows Open Source Edition.

You are licensed to use this software under the terms of
the GNU General Public License (GPL) version 2 or 3.

Type '2' to view the GNU General Public License version 2 (GPLv2).
Type '3' to view the GNU General Public License version 3 (GPLv3).
Type 'y' to accept this license offer.
Type 'n' to decline this license offer.

Do you accept the terms of the license?
y
Setting Direct3D to NO, since the proper Direct3D SDK was not detected.
Make sure you have the Direct3D SDK installed, and that you have run
the <path to SDK>\Utilities\Bin\dx_setenv.cmd script.
The D3D SDK library path *needs* to appear before the Platform SDK library
path in your LIB environment variable.
Environment:
INCLUDE=
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include

LIB=
C:\Program Files\Microsoft Visual Studio 9.0\VC\LIB
C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib

PATH=
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN
C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools
C:\WINDOWS\Microsoft.NET\Framework\v3.5
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
C:\Program Files\Microsoft Visual Studio 9.0\VC\VCPackages
C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin
C:\WINDOWS\system32
C:\WINDOWS
C:\WINDOWS\System32\Wbem
You are licensed to use this software under the terms of the GNU GPL version 2 o
r 3.
See C:/qt/LICENSE.GPL2
or C:/qt/LICENSE.GPL3

Configuration:
dist-config
large-config
medium-config
minimal-config
small-config
full-config
build_all
debug
Qt Configuration:
release
debug
zlib
png
accessibility
qt3support
opengl
ipv6
xmlpatterns
phonon
phonon-backend
webkit
svg
minimal-config
small-config
medium-config
large-config
full-config

QMAKESPEC...................win32-msvc2008 (detected)
Architecture................windows
Maketool....................nmake
Debug symbols...............yes
Accessibility support.......yes
STL support.................yes
Exception support...........yes
RTTI support................yes
MMX support.................yes
3DNOW support...............yes
SSE support.................yes
SSE2 support................yes
IWMMXT support..............no
OpenGL support..............yes
Direct3D support............no
OpenSSL support.............no
QtDBus support..............no
QtXmlPatterns support.......yes
Phonon support..............yes
WebKit support..............yes
Qt3 compatibility...........yes

Third Party Libraries:
ZLIB support............qt
GIF support.............plugin
TIFF support............plugin
JPEG support............plugin
PNG support.............qt
MNG support.............plugin

Styles:
Windows.................yes
Windows XP..............yes
Windows Vista...........yes
Plastique...............yes
Cleanlooks..............yes
Motif...................yes
CDE.....................yes
Windows CE..............no
Windows Mobile..........no

Sql Drivers:
ODBC....................no
MySQL...................no
OCI.....................no
PostgreSQL..............no
TDS.....................no
DB2.....................no
SQLite..................plugin (qt)
SQLite2.................no
InterBase...............no

Sources are in..............C:\qt
Build is done in............C:\qt
Install prefix..............C:\qt
Headers installed to........C:\qt\include
Libraries installed to......C:\qt\lib
Plugins installed to........C:\qt\plugins
Binaries installed to.......C:\qt\bin
Docs installed to...........C:\qt\doc
Data installed to...........C:\qt
Translations installed to...C:\qt\translations
Examples installed to.......C:\qt\examples
Demos installed to..........C:\qt\demos

Creating qmake...

Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.

Creating makefiles in src...
Generating Visual Studio project files...
Could not find mkspecs for your QMAKESPEC(win32-msvc2008) after trying:
C:\Qt4-shared\mkspecs
Error processing project file: C:/qt/projects.pro
Qmake failed, return code 3

Generating Makefiles...
Could not find mkspecs for your QMAKESPEC(win32-msvc2008) after trying:
C:\Qt4-shared\mkspecs
Error processing project file: C:/qt/projects.pro
Qmake failed, return code 3


C:\qt>

chris062689
9th October 2008, 10:05
After looking around, it appears that Microsoft Visual Studio C++ Express isn't supported? :crying:

Is MSVS 2005 Express supported?
Is there a way I can use MSVS 2008 Express with Qt?

I'll just do it with MSVS 2005 Express...
I followed this guide: http://53prime.com/?p=87
I'll report back if it works!
[EDIT: Nope, msvs 2005 express isn't supported either?!]

chris062689
9th October 2008, 12:37
Does anyone have a good tutorial on how to install Eclipse, Qt, Mingw?
I guess I'll just use Eclipse. I really don't care as long as I can use Qt! :p

wysota
9th October 2008, 19:41
As far as I know msvc-2008 is supported... I can see support for it in both the commercial and open source editions. If you use prefix in Windows, you have to manually copy the mkspecs directory or issue make install_mkspecs before building Qt. There is something wrong with the compilation process and qmake looks for the specs in a wrong directory.

chris062689
9th October 2008, 21:56
Trying Eclipse... this is giving me a migraine.

(After I ran configure, I ran mingw32make, this is what happened)

[tons of code here]
Could Not Find C:\Qt\4.4.3\qmake\project.o
del qmake
Could Not Find C:\Qt\4.4.3\qmake\qmake
mingw32-make[1]: Leaving directory `C:/Qt/4.4.3/qmake'
mingw32-make: *** No rule to make target `configure'. Stop.

C:\Qt\4.4.3>make
cd \src\winmain\ && c:\Qt\4.4.3\bin\qmake.exe winmain.pro -win32 -o Makefile
Cannot find file: winmain.pro.
mingw32-make: *** [\src\winmain\Makefile] Error 2

C:\Qt\4.4.3>


I think I'm getting closer, but what's wrong?

wysota
10th October 2008, 00:01
Ok, but why are you trying to build Qt if you already have it built for MinGW? Don't try to make things harder than they are.

chris062689
10th October 2008, 00:09
When I try to compile a program using g++, it comes back with errors...
So I assumed I needed to compile it..

OK, what steps do you suggest doing to install Qt / Eclipse? :(

wysota
10th October 2008, 08:03
I already wrote that few posts earlier. Install the binary package and you're ready to go. If you want eclipse integration, install the integration package and again you should be ready to go. Just make sure proper environment variables are defined. You can do that by using the "Qt command prompt" entry from the start menu.

chris062689
10th October 2008, 09:45
What?
I tried installing that binary package, and then tried compiling my Hello World program with "g++", it came back with errors

C:\Documents and Settings\Administrator\My Documents\QtExamples\helloworld>g++ h
elloworld.cpp
helloworld.cpp:1:25: QApplication: No such file or directory
helloworld.cpp:2:24: QPushButton: No such file or directory
helloworld.cpp: In function `int main(int, char**)':
helloworld.cpp:6: error: `QApplication' was not declared in this scope
helloworld.cpp:6: error: expected `;' before "app"
helloworld.cpp:8: error: `QPushButton' was not declared in this scope
helloworld.cpp:8: error: expected `;' before "hello"
helloworld.cpp:9: error: `hello' was not declared in this scope
helloworld.cpp:12: error: `app' was not declared in this scope
helloworld.cpp:13:3: warning: no newline at end of file


#include <QApplication>
#include <QPushButton>

int main(int argc, char *argv[])
{
QApplication app(argc, argv);

QPushButton hello("Hello world!");
hello.resize(100, 30);

hello.show();
return app.exec();
}

I'm so confused what I'm SUPPOSED to do and what I'm NOT SUPPOSED to do.. :crying:

chris062689
10th October 2008, 10:13
/sheds a tear. :crying:
I *finally* compiled my own program! :)

But.. it took so many steps...



C:\MyQT\helloworld>dir
Volume in drive C has no label.

Directory of C:\MyQT\helloworld

10/10/2008 05:12 AM <DIR> .
10/10/2008 05:12 AM <DIR> ..
10/10/2008 04:38 AM 249 helloworld.cpp
1 File(s) 249 bytes
2 Dir(s) 217,473,863,680 bytes free

C:\MyQT\helloworld>qmake -project

C:\MyQT\helloworld>qmake

C:\MyQT\helloworld>make
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/MyQT/helloworld'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..
\Qt\4.4.3\include\QtCore" -I"..\..\Qt\4.4.3\include\QtCore" -I"..\..\Qt\4.4.3\in
clude\QtGui" -I"..\..\Qt\4.4.3\include\QtGui" -I"..\..\Qt\4.4.3\include" -I"." -
I"c:\Qt\4.4.3\include\ActiveQt" -I"debug" -I"." -I"..\..\Qt\4.4.3\mkspecs\win32-
g++" -o debug\helloworld.o helloworld.cpp
helloworld.cpp:13:3: warning: no newline at end of file
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -mthreads -Wl -Wl,-subsystem,windows -o debug\helloworld.exe debug/helloworld
.o -L"c:\Qt\4.4.3\lib" -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4
mingw32-make[1]: Leaving directory `C:/MyQT/helloworld'

C:\MyQT\helloworld>


Is there anyway I can.. condense that?
How exactly do I integrate it with Eclipse now?

Wait.. why does it only work when I execute it from the QT command line?
Why can't I run it in Windows Explorer? :confused:

This application has failed to start because mingw10.dll was not found.

wysota
10th October 2008, 21:35
I *finally* compiled my own program! :)
Congatulations. Reading the docs often pays back :)


Is there anyway I can.. condense that?
You rarely need to call qmake again, so when you change something and want to recompile, you only call make.


How exactly do I integrate it with Eclipse now?
You might start with downloading the Qt Eclipse integration available from Trolltech site.


Wait.. why does it only work when I execute it from the QT command line?
Why can't I run it in Windows Explorer? :confused:

This application has failed to start because mingw10.dll was not found.

I think you already know the answer :)

chris062689
11th October 2008, 01:06
I think you already know the answer :)
You sir, do not know how to read the Topic Title.
Re: Installing Qt 4.4 for Morons?

Why can't I run them without the Qt Command Prompt?

wysota
11th October 2008, 08:56
It would help if you actually started reading some docs instead of trying things blind...

The command prompt sets paths and environment variables to both Qt and MinGW. Without it you need to make sure your system can find all the libraries when running an application. In that case the runtime of MinGW that is probably not sitting where it should (in a global system library path like C:\Windows\System or a local library path like the directory containing the binary you are trying to execute). This is all basic stuff concerning programming. You should really try to learn your deployment environment (Windows operating system in your case) before doing any software development on your own.