Results 1 to 3 of 3

Thread: Demo projects not compiling

  1. #1
    Join Date
    May 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows Symbian S60

    Default Demo projects not compiling

    I am a newbie

    - i installed QT's LGPL version
    - i have QT creator version 1.3.1 based on Qt 4.6.2
    - ming version shown is 4.4


    When I try to load and build any demo projects, I get this kind of errors (hundreds of them)....any help would be appreciated

    D:\Qt\qt\examples\dialogs\licensewizard/licensewizard.cpp:51: undefined reference to `_imp___ZN7QWizard7setPageEiP11QWizardPage'


    d:/qt/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libmingw32.a(main.o):main.c::-1: error: undefined reference to `WinMain@16'

  2. #2
    Join Date
    May 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Demo projects not compiling

    I am having the same problem. Qt 4.6.2 samples don't build.
    I can't find any help in the documentation. The "c:\Qt\2010.02.1\qt\lib" used in the command line exists and is populated. The libraries specified by -l (e.g. libQtCored4.a) exist.

    I get the same errors when manually running the link on the command line:

    C:\Qt\2010.02.1\qt\examples\mainwindows\applicatio n>C:\Qt\2010.02.1\mingw\bin\g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\application.exe tmp/obj/debug_shared/main.o tmp/obj/debug_shared/mainwindow.o tmp/obj/debug_shared/moc_mainwindow.o tmp/obj/debug_shared/qrc_application.o -L"c:\Qt\2010.02.1\qt\lib" -L"c:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Lib\" -L"c:\Qt\2010.02.1\qt\lib" -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4


    Error Output:
    -----------------------------
    g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\application.exe tmp/obj/debug_shared/main.o tmp/obj/debug_shared/mainwindow.o tmp/obj/debug_shared/moc_mainwindow.o tmp/obj/debug_shared/qrc_application.o -L"c:\Qt\2010.02.1\qt\lib" -L"c:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Lib\" -L"c:\Qt\2010.02.1\qt\lib" -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4

    tmp/obj/debug_shared/main.o: In function `Z5qMainiPPc':
    C:\Qt\2010.02.1\qt\examples\mainwindows\applicatio n/main.cpp:51: undefined reference to `_imp___ZN12QApplicationC1ERiPPci'
    C:\Qt\2010.02.1\qt\examples\mainwindows\applicatio n/main.cpp:52: undefined reference to `_imp___ZN16QCoreApplication19setOrganizationNameE RK7QString'
    C:\Qt\2010.02.1\qt\examples\mainwindows\applicatio n/main.cpp:53: undefined reference to `_imp___ZN16QCoreApplication18setApplicationNameER K7QString'
    C:\Qt\2010.02.1\qt\examples\mainwindows\applicatio n/main.cpp:56: undefined reference to `_imp___ZN12QApplication4execEv'
    C:\Qt\2010.02.1\qt\examples\mainwindows\applicatio n/main.cpp:56: undefined reference to `_imp___ZN12QApplicationD1Ev'
    C:\Qt\2010.02.1\qt\examples\mainwindows\applicatio n/main.cpp:56: undefined reference to `_imp___ZN12QApplicationD1Ev'
    tmp/obj/debug_shared/main.o: In function `QString':
    C:\Qt\2010.02.1\qt\examples\mainwindows\applicatio n/../../../include/QtCore/../../src/corelib/tools/qstring.h:413: undefined reference to `_imp___ZN7QString16fromAscii_helperEPKci'
    tmp/obj/debug_shared/main.o: In function `~QString':
    C:\Qt\2010.02.1\qt\examples\mainwindows\applicatio n/../../../include/QtCore/../../src/corelib/tools/qstring.h:869: undefined reference to `_imp___ZN7QString4freeEPNS_4DataE'
    tmp/obj/debug_shared/main.o: In function `~MainWindow':
    C:\Qt\2010.02.1\qt\examples\mainwindows\applicatio n/mainwindow.h:55: undefined reference to `_imp___ZN11QMainWindowD2Ev'
    C:\Qt\2010.02.1\qt\examples\mainwindows\applicatio n/mainwindow.h:55: undefined reference to `_imp___ZN11QMainWindowD2Ev'
    .
    <thousands of similar errors>
    .
    tmp/obj/debug_shared/qrc_application.o: In function `Z29qCleanupResources_applicationv':
    C:\Qt\2010.02.1\qt\examples\mainwindows\applicatio n/tmp/rcc/debug_shared/qrc_application.cpp:645: undefined reference to `_imp___Z23qUnregisterResourceDataiPKhS0_S0_'
    c:/qt/2010.02.1/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libmingw32.a(main.o):main.c.text+0x104): undefined reference to `WinMain@16'
    collect2: ld returned 1 exit status
    mingw32-make[1]: Leaving directory `C:/Qt/2010.02.1/qt/examples/mainwindows/application'
    mingw32-make: Leaving directory `C:/Qt/2010.02.1/qt/examples/mainwindows/application'
    mingw32-make[1]: *** [debug\application.exe] Error 1
    mingw32-make: *** [debug-all] Error 2
    Exited with code 2.
    Error while building project application
    When executing build step 'Make'
    -----------------------------

  3. #3
    Join Date
    May 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Demo projects not compiling

    I figured out the cause. It looks like a bug in QtCreator or the Qt config process in how it handles the Microsoft LIB environment variable. GCC is choking on this:

    -L"c:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Lib\"

    because it ends in a trailing backslash and that somehow confuses it. Qt copies that Microsoft environment variable to the linker command line without removing the trailing backslash. I tend to think that's a bug.

    To fix it you need to modify your environment variable yourself in your Windows settings or you need to somehow fix the QT install. How? Edit a config file somewhere?

Similar Threads

  1. Qt Demo is scrambled on Windows XP
    By samalex in forum Qt-based Software
    Replies: 1
    Last Post: 9th April 2009, 20:52
  2. QT Demo browser does not work !
    By torpedo in forum Qt Tools
    Replies: 3
    Last Post: 7th April 2009, 10:56
  3. Problem cross compiling examples/demo on mips.Qmake/Linking?
    By Cursedbeasty in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 5th July 2007, 10:53
  4. Disable demo & example ? by install mac
    By patrik08 in forum Installation and Deployment
    Replies: 3
    Last Post: 11th July 2006, 18:19

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.