Sunday, July 20th 2008, 2:28pm UTC+1

You are not logged in.

  • Login
  • Register

1

Wednesday, January 16th 2008, 12:52pm

QT 4.3.3, WXP, not working

I downloaded qt-win-opensource-4.3.3-mingw.exe and ran it. Installation seemed to go okay - I received no error messages, and I can open Qt Designer and Qt Assistant, etc. But when I go to the tutorial and try to run the "hello world!" example, I run into problems. I do qmake -project and qmake, and that seems to work. But when I type make, I get the following:

C:\Qt\4.3.3\myprojects\hello2>make
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `C:/Qt/4.3.3/myprojects/hello2'
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"
..\..\include\QtCore" -I"..\..\include\QtCore" -I"..\..\include\QtGui" -I"..\..\include\QtGui" -I"..\..\include" -I"." -I"c:\Qt\4.3.3\include\ActiveQt" -I"tmp\moc\release
_shared" -I"." -I"c:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\include" -I"..\..\mkspecs\win32-g++" -o tmp\obj\release_shared\hello2.o hello2.cpp
hello2.cpp:14:2: warning: no newline at end of file
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o release\hello2.exe tmp/obj/release_share
d/hello2.o -L"c:\Qt\4.3.3\lib" -L"c:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Lib\" -L"c:\Qt\4.3.3\lib" -lmingw32 -lqtmain -lQtGui4 -lQtCore4
tmp/obj/release_shared/hello2.o(.text+0x6b):hello2.cpp: undefined reference to `_imp___ZN12QApplicationC1ERiPPci'
tmp/obj/release_shared/hello2.o(.text+0x76):hello2.cpp: undefined reference to `_imp___ZN7QString16fromAscii_helperEPKci'
tmp/obj/release_shared/hello2.o(.text+0xa1):hello2.cpp: undefined reference to `_imp___ZN11QPushButtonC1ERK7QStringP7QWidget'
tmp/obj/release_shared/hello2.o(.text+0xd8):hello2.cpp: undefined reference to `_imp___ZN7QString4freeEPNS_4DataE'
tmp/obj/release_shared/hello2.o(.text+0xfc):hello2.cpp: undefined reference to `_imp___ZN7QWidget6resizeERK5QSize'
tmp/obj/release_shared/hello2.o(.text+0x12b):hello2.cpp: undefined reference to `_imp___ZN12QApplication4execEv'
tmp/obj/release_shared/hello2.o(.text+0x147):hello2.cpp: undefined reference to `QPushButton::~QPushButton()'
tmp/obj/release_shared/hello2.o(.text+0x15d):hello2.cpp: undefined reference to `QApplication::~QApplication()'
tmp/obj/release_shared/hello2.o(.text+0x1ae):hello2.cpp: undefined reference to `QPushButton::~QPushButton()'
tmp/obj/release_shared/hello2.o(.text+0x1cf):hello2.cpp: undefined reference to `QApplication::~QApplication()'
tmp/obj/release_shared/hello2.o(.text+0x214):hello2.cpp: undefined reference to `_imp___ZN7QString4freeEPNS_4DataE'
/mingw/lib/libmingw32.a(main.o)(.text+0x106):main.c: undefined reference to `WinMain@16'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [release\hello2.exe] Error 1
mingw32-make[1]: Leaving directory `C:/Qt/4.3.3/myprojects/hello2'
mingw32-make: *** [release] Error 2

All these "undefined references" makes me think maybe installation didn't go as smoothly as I thought. What am I doing wrong?
  • Go to the top of the page

macabre13

Trainee

Posts: 127

Location: Poland/ Wroclaw

Occupation: sw developer

2

Wednesday, January 16th 2008, 2:41pm

undefined references - it rather says that linker cannot find the .lib files. Please check your path and make sure that linker will find your qt lib files.

Or simply run qtvars.bat that should help
- ebm - noise - industrial -
I always could be wrong.
Lets share knowledge!

This post has been edited 1 times, last edit by "macabre13" (Jan 16th 2008, 2:42pm)

  • Go to the top of the page

3

Wednesday, January 16th 2008, 7:56pm

Quoted

Originally posted by macabre13
undefined references - it rather says that linker cannot find the .lib files. Please check your path and make sure that linker will find your qt lib files.

Or simply run qtvars.bat that should help


I ran qtvars.bat and it didn't seem to help. I then manually added the changes to my path that qtvars.bat was supposed to make, and that didn't help. I'm still stymied.
  • Go to the top of the page

macabre13

Trainee

Posts: 127

Location: Poland/ Wroclaw

Occupation: sw developer

4

Wednesday, January 16th 2008, 8:00pm

well...
Ok, you have QT in oss version, did you install mingw? And do U use it do compile and link your application?

Could you paste yours set and path variables?

Just in case:
in command line invoke
set <enter>
path <enter>
- ebm - noise - industrial -
I always could be wrong.
Lets share knowledge!
  • Go to the top of the page

5

Wednesday, January 16th 2008, 10:30pm

Quoted

Originally posted by macabre13
well...
Ok, you have QT in oss version, did you install mingw? And do U use it do compile and link your application?


During installation, it downloaded and installed mingw. As far as using that to compile and link my application, I confess at this point I am just following the recipe given in the tutorial: save the source file in its own directory, go to that directory and run qmake -project, then qmake, then make.

Quoted


Could you paste yours set and path variables?

Just in case:
in command line invoke
set <enter>
path <enter>


c:\>set
ALLUSERSPROFILE=C:\Documents and Settings\All Users
APPDATA=C:\Documents and Settings\Joe\Application Data
CLIENTNAME=Console
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=xxx
ComSpec=C:\WINDOWS\system32\cmd.exe
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Documents and Settings\Joe
INCLUDE=C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\include\
LIB=C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Lib\
LOGONSERVER=\\xxx
NUMBER_OF_PROCESSORS=2
OS=Windows_NT
Path=C:\Perl\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Java\j2sdk1.4.2_12\bin;c:\wspan\swgw;C:\Program Files\ZipGenius 6\;C:\Qt\4.3.3\bin;C:\MinGW\bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 14 Stepping 8, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0e08
ProgramFiles=C:\Program Files
PROMPT=$P$G
SESSIONNAME=Console
SonicCentral=C:\Program Files\Common Files\Sonic Shared\Sonic Central\
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\DOCUME~1\Joe\LOCALS~1\Temp
TMP=C:\DOCUME~1\Joe\LOCALS~1\Temp
USERDOMAIN=xxx
USERNAME=Joe
USERPROFILE=C:\Documents and Settings\Joe
VS71COMNTOOLS=C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\
VS80COMNTOOLS=C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\
windir=C:\WINDOWS

c:\>path
PATH=C:\Perl\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Java\j2sdk1.4.2_12\bin;c:\wspan\swgw;C:\Program Files\ZipGenius 6\;C:\Qt\4.3.3\bin;C:\MinGW\bin

Is that any help?
  • Go to the top of the page

macabre13

Trainee

Posts: 127

Location: Poland/ Wroclaw

Occupation: sw developer

6

Wednesday, January 16th 2008, 10:39pm

I had kind of similiar problem with the path. I mean mingw/qt seems to have problem with spaces in path so I did move all mingw/qt declaration in front of my path.

Sth like this:

PATH=c:\qt\x.x.x\bin;c:\mingw\bin;any_other_path_without_spaces;any other with spaces

Maybe this will help :?
- ebm - noise - industrial -
I always could be wrong.
Lets share knowledge!
  • Go to the top of the page

7

Thursday, January 17th 2008, 12:18am

Quoted

Originally posted by macabre13
I had kind of similiar problem with the path. I mean mingw/qt seems to have problem with spaces in path so I did move all mingw/qt declaration in front of my path.

Sth like this:

PATH=c:\qt\x.x.x\bin;c:\mingw\bin;any_other_path_without_spaces;any other with spaces

Maybe this will help :?


That did it! I read some place about spaces in path, but in my ignorance I thought it meant the actual path to Qt, like I couldn't have it be C:\Qt Stuff\4.3.3\ But just changing the path variable around did it. Thanks so much!
  • Go to the top of the page

macabre13

Trainee

Posts: 127

Location: Poland/ Wroclaw

Occupation: sw developer

8

Thursday, January 17th 2008, 8:48am

[QT] rules!
- ebm - noise - industrial -
I always could be wrong.
Lets share knowledge!
  • Go to the top of the page

Rate this thread