Hey All,
i am new to Qt.
my steps are here for making my first “helloworld App” in fresh installed Windows XP Sp3 32b with latest updates.
1. install QT Qt 4.8.4 with default folder:C:\Qt\4.8.4 (I don’t have QtCreator installed)
2. install mingw as well. C:\MinGW
3. add windows environmental variables.
QTDIR = C:\Qt\4.8.4
PATH = %QTDIR%\bin;C:\MinGW\bin\;%PATH%
QMAKE = win32-g++
Code main.cpp,
#include <QApplication>
#include <QPushButton>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton hello("Hello world!");
hello.show();
return app.exec();
}
then run the commands in Command promopt.
C:\Documents and Settings\Administrator\Desktop\Qt-Projects\test01>gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.7.2/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.7.2/configure —enable-languages=c,c++,ada,fortran,obj
c,obj-c++ —disable-sjlj-exceptions —with-dwarf2 —enable-shared —enable-libgo
mp —disable-win32-registry —enable-libstdcxx-debug —disable-build-poststage1-
with-cxx —enable-version-specific-runtime-libs —build=mingw32 —prefix=/mingw
Thread model: win32
gcc version 4.7.2 (GCC)
C:\Documents and Settings\Administrator\Desktop\Qt-Projects\test01>qmake -v
QMake version 2.01a
Using Qt version 4.8.4 in C:\Qt\4.8.4\lib
C:\Documents and Settings\Administrator\Desktop\Qt-Projects\test01>make -v
GNU Make 3.82.90
Built for i686-pc-mingw32
Copyright (C) 1988-2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
C:\Documents and Settings\Administrator\Desktop\Qt-Projects\test01>qmake -project
C:\Documents and Settings\Administrator\Desktop\Qt-Projects\test01>qmake
C:\Documents and Settings\Administrator\Desktop\Qt-Projects\test01>make
mingw32-make -f Makefile.Debug
mingw32-make1: Entering directory ‘C:/Documents and Settings/Administrator/Des
ktop/Qt-Projects/test01’
g++ -c -pipe -g -frtti -fexceptions -mthreads -Wall -Wextra -DUNICODE -DQT_LARGE
FILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW – DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAI
N -I“c:\Qt\4.8.4\include\QtCore” -I“c:\Qt\4.8.4\include\QtGui” -I“c:\Qt\4.8.4\in
clude” -I”.” -I“c:\Qt\4.8.4\include\ActiveQt” -I“debug” -I“c:\Qt\4.8.4\mkspecs\w
in32-g++” -o debug\main.o main.cpp
g++ -mthreads -Wl,-subsystem,windows -o debug\test01.exe debug/main.o -L“c:\Qt\
4.8.4\lib” -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4
mingw32-make1: Leaving directory ‘C:/Documents and Settings/Administrator/Desk
top/Qt-Projects/test01’
C:\Documents and Settings\Administrator\Desktop\Qt-Projects\test01>
looks everything is working fine without errors.
but when I try to run the test01.exe under debug folder,
the error message:
“test01.exe has encoutered a problem and needs to close……………..”
i can see an event log like this
Event Type: Error
Event Source: Application Error
Event Category: None
Event ID: 1000
Date: 2/1/2013
Time: 10:37:52 PM
User: N/A
Computer: QQ-0AE4989DC926
Description:
Faulting application test01.exe, version 0.0.0.0, faulting module test01.exe, version 0.0.0.0, fault address 0×00001fc8.
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Data:
0000: 41 70 70 6c 69 63 61 74 Applicat
0008: 69 6f 6e 20 46 61 69 6c ion Fail
0010: 75 72 65 20 20 74 65 73 ure tes
0018: 74 30 31 2e 65 78 65 20 t01.exe
0020: 30 2e 30 2e 30 2e 30 20 0.0.0.0
0028: 69 6e 20 74 65 73 74 30 in test0
0030: 31 2e 65 78 65 20 30 2e 1.exe 0.
0038: 30 2e 30 2e 30 20 61 74 0.0.0 at
0040: 20 6f 66 66 73 65 74 20 offset
0048: 30 30 30 30 31 66 63 38 00001fc8
0050: 0d 0a ..
is there anyboday who has experience on this? please guide me
thank you very much.
Frank
↧