PDA

View Full Version : New Win install, Hello World compile error.



dougbroadwell
2nd April 2008, 22:53
I have just installed 4.3.4 (from installer, not compiled from source). I cut and pasted the "Hello World" example out of Examples & Demos and get the following errors:


C:\Data\IT\Forms\hi>make
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `C:/Data/IT/Forms/hi'
gcc -c -O2 -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUP
PORT -DQT_NEEDS_QMAIN -I"..\..\..\Qt4.3.4\include\QtCore" -I"..\..\..\Qt4.3.4\include\QtCore" -I"..\..\..\Qt4.3.4\i
nclude\QtGui" -I"..\..\..\Qt4.3.4\include\QtGui" -I"..\..\..\Qt4.3.4\include" -I"." -I"c:\Data\Qt4.3.4\include\Acti
veQt" -I"release" -I"." -I"..\..\..\Qt4.3.4\mkspecs\win32-g++" -o release\hi.o hi.c
In file included from ../../../Qt4.3.4/include/QtCore/qnamespace.h:1,
from ../../../Qt4.3.4/include/QtCore/../../src/corelib/kernel/qobjectdefs.h:47,
from ../../../Qt4.3.4/include/QtCore/qobjectdefs.h:1,
from ../../../Qt4.3.4/include/QtCore/../../src/corelib/kernel/qobject.h:49,
from ../../../Qt4.3.4/include/QtCore/qobject.h:1,
from ../../../Qt4.3.4/include/QtCore/../../src/corelib/kernel/qcoreapplication.h:47,
from ../../../Qt4.3.4/include/QtCore/qcoreapplication.h:1,
from ../../../Qt4.3.4/include/QtGui/../../src/gui/kernel/qapplication.h:47,
from ../../../Qt4.3.4/include/QtGui/qapplication.h:1,
from ../../../Qt4.3.4/include/QtGui/QApplication:1,
from hi.c:1:
../../../Qt4.3.4/include/QtCore/../../src/corelib/global/qnamespace.h:51: error: syntax error before "QT_MODULE"
../../../Qt4.3.4/include/QtCore/../../src/corelib/global/qnamespace.h:54: error: syntax error before "namespace"
../../../Qt4.3.4/include/QtCore/../../src/corelib/global/qnamespace.h:58: error: syntax error before '{' token
../../../Qt4.3.4/include/QtCore/../../src/corelib/global/qnamespace.h:117: warning: return type defaults to `int'
../../../Qt4.3.4/include/QtCore/../../src/corelib/global/qnamespace.h: In function `Q_DECLARE_FLAGS':
../../../Qt4.3.4/include/QtCore/../../src/corelib/global/qnamespace.h:118: error: `Qt' undeclared (first use in thi
s function)
../../../Qt4.3.4/include/QtCore/../../src/corelib/global/qnamespace.h:118: error: (Each undeclared identifier is re
ported only once
../../../Qt4.3.4/include/QtCore/../../src/corelib/global/qnamespace.h:118: error: for each function it appears in.)

../../../Qt4.3.4/include/QtCore/../../src/corelib/global/qnamespace.h:118: confused by earlier errors, bailing out
mingw32-make[1]: *** [release/hi.o] Error 1
mingw32-make[1]: Leaving directory `C:/Data/IT/Forms/hi'
mingw32-make: *** [release] Error 2

Thanks

jacek
3rd April 2008, 00:39
Rename your file to hi.cpp and try again.

dougbroadwell
3rd April 2008, 00:51
I always feel so dumb when I make stupid errors like that.

Now I get the following error:


C:\Data\IT\Forms\hi>make
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Data/IT/Forms/hi'
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"..\..\..\Qt4.3.4\include\QtCore" -I"..\..\..\Qt4.3.4\include\QtCore" -I"..\
..\..\Qt4.3.4\include\QtGui" -I"..\..\..\Qt4.3.4\include\QtGui" -I"..\..\..\Qt4.3.4\include" -I"." -I"c:\Data\Qt4.3
.4\include\ActiveQt" -I"debug" -I"." -I"..\..\..\Qt4.3.4\mkspecs\win32-g++" -o debug\hi.o hi.cpp
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,win
dows -o debug\hi.exe debug/hi.o -L"c:\Data\Qt4.3.4\lib" -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4
C:\Data\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\. .\..\mingw32\bin\ld.exe: cannot find -lQtGuid4
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\hi.exe] Error 1
mingw32-make[1]: Leaving directory `C:/Data/IT/Forms/hi'
mingw32-make: *** [debug] Error 2

ChristianEhrlicher
3rd April 2008, 06:53
The Qt debug libs are not compiled - you have to compile them by your own when you install the binary package. If you don't know how to do this -> search function (it was discussed many times here)