Results 1 to 4 of 4

Thread: New Win install, Hello World compile error.

  1. #1
    Join Date
    Dec 2007
    Posts
    16
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default New Win install, Hello World compile error.

    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
    Last edited by jpn; 3rd April 2008 at 06:30. Reason: missing [quote] tags

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: New Win install, Hello World compile error.

    Rename your file to hi.cpp and try again.

  3. #3
    Join Date
    Dec 2007
    Posts
    16
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: New Win install, Hello World compile error.

    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
    Last edited by jpn; 3rd April 2008 at 06:31. Reason: missing [quote] tags

  4. #4
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    554
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: New Win install, Hello World compile error.

    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)

Similar Threads

  1. QPSQL driver in windows
    By brevleq in forum Installation and Deployment
    Replies: 31
    Last Post: 14th December 2007, 12:57
  2. Error compiling psql plugin
    By vieraci in forum Installation and Deployment
    Replies: 4
    Last Post: 7th October 2007, 02:49
  3. Qtopia core 4.2.2 cross compile make error
    By smiyai18 in forum Installation and Deployment
    Replies: 2
    Last Post: 28th August 2007, 17:04
  4. qt 4.2.2 install on aix
    By try to remember in forum Installation and Deployment
    Replies: 2
    Last Post: 28th March 2007, 12:19
  5. use qpsql
    By raphaelf in forum Installation and Deployment
    Replies: 34
    Last Post: 22nd August 2006, 12:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.