PDA

View Full Version : Compiling?



Afflicted.d2
15th October 2006, 16:41
Hi, I'm using Qt 4.2 trial... to complete an assignment.. but I have no clue how to use Qt at all so I'm trying to look at examples on the internete some which are source code... I don't know how to compile this source code from Qt itself, there's only the Qt designer, Qt assistant and the Qt linguist.

jacek
15th October 2006, 18:36
You need MinGW or M$ compiler (depending on the Qt version you have).

If you have one installed, open command prompt (there's a link in start menu called "Qt 4.2.x command prompt" or similar), go to the directory where the source code is, run "qmake" and then "make" (or "nmake"). If there is no .pro file with the sources, you will have to run "qmake -project" before "qmake".

merlvingian
15th October 2006, 18:59
A free version is available from M$ of 2005 express if you wish to use a MS IDE.

http://msdn.microsoft.com/vstudio/express/

Afflicted.d2
16th October 2006, 18:18
I did as you told me but... I'm still getting errors... aghhh how can I get this to run... ;\

Setting up a Qt environment...
-- QTDIR set to C:\Qt\4.2.0
-- Added C:\Qt\4.2.0\bin to PATH
-- QMAKESPEC set to win32-msvc2005
Setting environment for using Microsoft Visual Studio 2005 x86 tools.
C:\Qt\4.2.0>cd C:\Qt\4.2.0\examples\tutorial\t1

C:\Qt\4.2.0\examples\tutorial\t1>qmake -project

C:\Qt\4.2.0\examples\tutorial\t1>qmake

C:\Qt\4.2.0\examples\tutorial\t1>make
'make' is not recognized as an internal or external command,
operable program or batch file.

C:\Qt\4.2.0\examples\tutorial\t1>nmake

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

"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\nmake.exe" -f Makefil
e.Release

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

cl -c -nologo -Zm200 -Zc:wchar_t- -O2 -MD -O2 -MD -GR -EHsc -W3 -w34100
-w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_EVAL -DQT_EDITION=QT_EDITI
ON_DESKTOP -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT
-I"C:/Qt/4.2.0/include/QtCore" -I"C:/Qt/4.2.0/include/QtCore" -I"C:/Qt/4.2.0/in
clude/QtGui" -I"C:/Qt/4.2.0/include/QtGui" -I"C:/Qt/4.2.0/include" -I"." -I"C:/Q
t/4.2.0/include/ActiveQt" -I"tmp\moc\release_shared" -I"." -I"..\..\..\mkspecs\w
in32-msvc2005" -Fotmp\obj\release_shared\ @C:\DOCUME~1\PHILLI~1\LOCALS~1\Temp\nm
7F.tmp
main.cpp
link /LIBPATH:"c:\Qt\4.2.0\lib" /LIBPATH:"c:\Qt\4.2.0\lib" /NOLOGO /INCR
EMENTAL:NO /INCREMENTAL:NO /MANIFESTFILE:.\tmp\obj\release_shared\t1.exe.inter me
diate.manifest /SUBSYSTEM:WINDOWS /OUT:release\t1.exe @C:\DOCUME~1\PHILLI~1\LOCA
LS~1\Temp\nm80.tmp
LINK : fatal error LNK1104: cannot open file 'uuid.lib'
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\l
ink.EXE"' : return code '0x450'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\n
make.exe"' : return code '0x2'
Stop.

C:\Qt\4.2.0\examples\tutorial\t1>

I've also found a batch file along in the example t1.. but I can't get it to run, it displays a message of "This application has failed to start because QtGui4.dll was not found. Re-installing the application may fix this problem."

jacek
16th October 2006, 19:08
LINK : fatal error LNK1104: cannot open file 'uuid.lib'
It looks like m$ linker can't find "uuid.lib" library. Do you have such file on your system?

Afflicted.d2
16th October 2006, 19:24
I did a search. can't find such file, what should I do then ? =\

jacek
16th October 2006, 19:30
I did a search. can't find such file, what should I do then ? =\
I guess you need something called "platform SDK" from m$.

merlvingian
16th October 2006, 19:32
I did a search. can't find such file, what should I do then ? =\

Did you install the SDK? and have you done this:

When using VisualStudio 2005 Express, make sure that you have installed MS Platform SDK and that
the environment variables are set correct. Maybe you have to modify


C:\Program Files\Microsoft Visual Studio 8 Express\Common7\Tools\vsvars.bat
and add the paths to your Platform SDK installation:
change
@set INCLUDE=C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE;%INCLUDE%
to
@set INCLUDE=C:\Program Files\Microsoft Platform SDK\Include;C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE;%INCLUDE%

and
@set LIB=C:\Program Files\Microsoft Visual Studio 8\VC\LIB;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\lib;%LIB%
to
@set LIB=C:\Program Files\Microsoft Platform SDK\LIB;C:\Program Files\Microsoft Visual Studio 8\VC\LIB;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\lib;%LIB%

That is from the patch readme.txt.


With a default install of express 2005 and SDK you should be able to get by with just replacing this portion:


@set PATH=C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;C:\Program Files\Microsoft Visual Studio 8\VC\BIN;C:\Program Files\Microsoft Visual Studio 8\Common7\Tools;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin;C:\WINDOWS\Microsoft.NET\Framework\ v2.0.50727;C:\Program Files\Microsoft Visual Studio 8\VC\VCPackages;%PATH%
@set INCLUDE=C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE;%INCLUDE%;C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\
@set LIB=C:\Program Files\Microsoft Visual Studio 8\VC\LIB;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\lib;%LIB%;C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib\
@set LIBPATH=C:\WINDOWS\Microsoft.NET\Framework\v2.0.50 727