Results 1 to 11 of 11

Thread: Why is this so hard. (Building examples)

  1. #1
    Join Date
    Feb 2010
    Posts
    4
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    Windows

    Default Why is this so hard. (Building examples)

    Hi guys and Ladies. Really want to learn QT. But why so hard to get going.

    Installed QT 4.6.2 binary, open source. Next -> Next -> Next etc on my Windows XP.

    Start Creator. Choose sample "Application". Choose Build.

    Now shouldn't this just work out of the box. Oh no. I get all the errors described below (shortened).

    I really don't want to proceed if I can't resolve this issue which shouldn't be there in the first place (think its important to get a good start, things can soon enough get difficult).

    Been sweeping the net for a couple of hours now without getting anything.

    Somebody got some pointers in the right direction please. Don't want to quit just yet, but I feel it's up hill right now. Please please.

    (already added som dirs to global path).

    B.R. Ohlfsen

    Running build steps for project application...
    Configuration unchanged, skipping QMake step.
    Starting: C:/Qt/2010_02_1/mingw/bin/mingw32-make.exe -w
    mingw32-make: Entering directory `C:/Qt/2010_02_1/qt/examples/mainwindows/application'
    C:/Qt/2010_02_1/mingw/bin/mingw32-make -f Makefile.Debug all
    mingw32-make[1]: Entering directory `C:/Qt/2010_02_1/qt/examples/mainwindows/application'
    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:\Programmer\SQLXML 4.0\bin\" -L"c:\Qt\2010_02_1\qt\lib" -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4
    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'
    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'
    tmp/obj/debug_shared/mainwindow.o: In function `MainWindow':
    C:\Qt\2010_02_1\qt\examples\mainwindows\applicatio n/mainwindow.cpp:49: undefined reference to `_imp___ZN11QMainWindowC2EP7QWidget6QFlagsIN2Qt10W indowTypeEE'
    C:\Qt\2010_02_1\qt\examples\mainwindows\applicatio n/mainwindow.cpp:52: undefined reference to `_imp___ZN14QPlainTextEditC1EP7QWidget'
    C:\Qt\2010_02_1\qt\examples\mainwindows\applicatio n/mainwindow.cpp:53: undefined reference to `_imp___ZN11QMainWindow16setCentralWidgetEP7QWidge t'
    C:\Qt\2010_02_1\qt\examples\mainwindows\applicatio n/mainwindow.cpp:63: undefined reference to `_imp___Z13qFlagLocationPKc'
    C:\Qt\2010_02_1\qt\examples\mainwindows\applicatio n/mainwindow.cpp:63: undefined reference to `_imp___Z13qFlagLocationPKc'
    C:\Qt\2010_02_1\qt\examples\mainwindows\applicatio n/mainwindow.cpp:63: undefined reference to `_imp___ZNK14QPlainTextEdit8documentEv'
    C:\Qt\2010_02_1\qt\examples\mainwindows\applicatio n/mainwindow.cpp:63: undefined reference to `_imp___ZN7QObject7connectEPKS_PKcS1_S3_N2Qt14Conn ectionTypeE'
    undefined reference to `QWidget::changeEvent(QEvent*)'
    tmp/obj/debug_shared/moc_mainwindow.o:moc_mainwindow.cpp:(.rdata$_ZTV10 MainWindow[vtable for MainWindow]+0xc0): undefined reference to `QWidget::metric(QPaintDevice::PaintDeviceMetric) const'
    tmp/obj/debug_shared/moc_mainwindow.o:moc_mainwindow.cpp:(.rdata$_ZTV10 MainWindow[vtable for MainWindow]+0xc4): undefined reference to `QWidget::inputMethodEvent(QInputMethodEvent*)'
    tmp/obj/debug_shared/moc_mainwindow.o:moc_mainwindow.cpp:(.rdata$_ZTV10 MainWindow[vtable for MainWindow]+0xc8): undefined reference to `QWidget::inputMethodQuery(Qt::InputMethodQuery) const'
    tmp/obj/debug_shared/moc_mainwindow.o:moc_mainwindow.cpp:(.rdata$_ZTV10 MainWindow[vtable for MainWindow]+0xcc): undefined reference to `QWidget::focusNextPrevChild(bool)'
    tmp/obj/debug_shared/moc_mainwindow.o:moc_mainwindow.cpp:(.rdata$_ZTV10 MainWindow[vtable for MainWindow]+0xd0): undefined reference to `QWidget::styleChange(QStyle&)'
    tmp/obj/debug_shared/moc_mainwindow.o:moc_mainwindow.cpp:(.rdata$_ZTV10 MainWindow[vtable for MainWindow]+0xd4): undefined reference to `QWidget::enabledChange(bool)'
    tmp/obj/debug_shared/moc_mainwindow.o:moc_mainwindow.cpp:(.rdata$_ZTV10 MainWindow[vtable for MainWindow]+0xd8): undefined reference to `QWidget::paletteChange(QPalette const&)'
    tmp/obj/debug_shared/moc_mainwindow.o:moc_mainwindow.cpp:(.rdata$_ZTV10 MainWindow[vtable for MainWindow]+0xdc): undefined reference to `QWidget::fontChange(QFont const&)'
    tmp/obj/debug_shared/moc_mainwindow.o:moc_mainwindow.cpp:(.rdata$_ZTV10 MainWindow[vtable for MainWindow]+0xe0): undefined reference to `QWidget::windowActivationChange(bool)'
    tmp/obj/debug_shared/moc_mainwindow.o:moc_mainwindow.cpp:(.rdata$_ZTV10 MainWindow[vtable for MainWindow]+0xe4): undefined reference to `QWidget::languageChange()'
    tmp/obj/debug_shared/moc_mainwindow.o:moc_mainwindow.cpp:(.rdata$_ZTV10 MainWindow[vtable for MainWindow]+0xe8): undefined reference to `QMainWindow::createPopupMenu()'
    tmp/obj/debug_shared/moc_mainwindow.o:moc_mainwindow.cpp:(.rdata$_ZTV10 MainWindow[vtable for MainWindow]+0xfc): undefined reference to `non-virtual thunk to QWidget::devType() const'
    tmp/obj/debug_shared/moc_mainwindow.o:moc_mainwindow.cpp:(.rdata$_ZTV10 MainWindow[vtable for MainWindow]+0x100): undefined reference to `non-virtual thunk to QWidget::paintEngine() const'
    tmp/obj/debug_shared/moc_mainwindow.o:moc_mainwindow.cpp:(.rdata$_ZTV10 MainWindow[vtable for MainWindow]+0x104): undefined reference to `non-virtual thunk to QWidget::getDC() const'
    tmp/obj/debug_shared/moc_mainwindow.o:moc_mainwindow.cpp:(.rdata$_ZTV10 MainWindow[vtable for MainWindow]+0x108): undefined reference to `non-virtual thunk to QWidget::releaseDC(HDC__*) const'
    tmp/obj/debug_shared/moc_mainwindow.o:moc_mainwindow.cpp:(.rdata$_ZTV10 MainWindow[vtable for MainWindow]+0x10c): undefined reference to `non-virtual thunk to QWidget::metric(QPaintDevice::PaintDeviceMetric) const'
    tmp/obj/debug_shared/moc_mainwindow.o: In function `~MainWindow':
    C:\Qt\2010_02_1\qt\examples\mainwindows\applicatio n/tmp/moc/debug_shared//../../../mainwindow.h:55: undefined reference to `_imp___ZN11QMainWindowD2Ev'
    C:\Qt\2010_02_1\qt\examples\mainwindows\applicatio n/tmp/moc/debug_shared//../../../mainwindow.h:55: undefined reference to `_imp___ZN11QMainWindowD2Ev'
    tmp/obj/debug_shared/qrc_application.o: In function `Z26qInitResources_applicationv':
    C:\Qt\2010_02_1\qt\examples\mainwindows\applicatio n/tmp/rcc/debug_shared/qrc_application.cpp:636: undefined reference to `_imp___Z21qRegisterResourceDataiPKhS0_S0_'
    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]: *** [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'

  2. #2
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Why is this so hard. (Building examples)

    can you show us your current path?
    Also, start the Qt Command Prompt and paste what is printed to the console.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Why is this so hard. (Building examples)

    What is "c:\Programmer\SQLXML 4.0\bin"? How did it end up in your linker path?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Feb 2010
    Posts
    4
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    Windows

    Default Re: Why is this so hard. (Building examples)

    Wow. Thanks for your swift replies.

    The path taken from Projekt->Run settings->Run environment is

    C:\Qt\2010_02_1\qt\bin;C:\Programmer\PC Connectivity Solution\;C:\Programmer\RSA SecurID Token Common;C:\Programmer\ThinkPad\Utilities;C:\WINDOWS \system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\P rogrammer\ZipGenius 6\;C:\Programmer\ATI Technologies\ATI.ACE\Core-Static;C:\Programmer\Fælles filer\Lenovo;C:\Programmer\Intel\Wireless\Bin\;C:\ Programmer\Microsoft SQL Server\80\Tools\Binn\;C:\Programmer\Microsoft SQL Server\90\DTS\Binn\;C:\Programmer\Microsoft SQL Server\90\Tools\binn\;C:\Programmer\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\;C:\Progr ammer\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\;C:\Programmer\jZi p;C:\Programmer\ThinkPad\ConnectUtilities;C:\Progr ammer\Bazaar;C:\Programmer\Java\jre1.6.0_07\bin\cl ient;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 ;C:\Programmer\Global Refund\Shop Assistant;C:\Programmer\OPOS\Epson2;c:\python26;C: \Programmer\IronPython 2.0.1;c:\progs\cmd;C:\Programmer\TortoiseSVN\bin;C :\Qt\2010_02_1\qt\bin;C:\Qt\2010_02_1\bin;C:\Qt\20 10_02_1\mingw\bin

    The path from the QT command prompt is

    C:\Qt\2010_02_1\qt\bin;C:\Qt\2010_02_1\bin;C:\Qt\2 010_02_1\mingw\bin;C:\WINDOWS\System32


    The "c:\Programmer\SQLXML 4.0\bin" is in an environment variable called LIB. I didn't put it there, and don't know what it's for. It's the only entry in the LIB environment variable.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Why is this so hard. (Building examples)

    I don't have such entry in my examples/mainwindows/application project file. Are you sure you didn't change any files? What exactly did you do to download, install Qt and build the example?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Why is this so hard. (Building examples)

    I'm not an expert but one other thing you could try is to build the app from the Qt command prompt - at least that will give you a 'clean' environment and path.
    There are these weird spaces in the path and also in the build log - is it a non-english OS (although that shouldn't matter).
    I also noticed visual studio 8 is in the path. I would put all Qt related entries at the front of the path, not at the end. Of course this won't matter if you build from the Qt command prompt.

  7. #7
    Join Date
    Dec 2009
    Posts
    8
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Why is this so hard. (Building examples)

    I had a similar problem to yours. (here)

    My solution was to move the entire examples directory from its location under C:\Nokia\Qt\2009.05\qt\examples to C:\Nokia\Qt\examples and then just open the examples like I would any other project. You could probably move this directory almost anywhere.

    Does this work-around work for you?

  8. #8
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Why is this so hard. (Building examples)

    Is that a space in the MinGW path?

    [edit]Oh, typo.
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

  9. #9
    Join Date
    Feb 2010
    Posts
    4
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    Windows

    Default Re: Why is this so hard. (Building examples)

    Thank you all for your interest and your help. Really appreciate it.

    The advice from Tvt204 did the trick. Weird but it works. Thanks Tvt204.

    By the way c:\Programmer\SQLXML 4.0\bin has to do with my Microsoft SQL server installation and then strange character in my path not easily identifyable is an underscore _.

    Kindest regards
    Ohlfsen

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Why is this so hard. (Building examples)

    Quote Originally Posted by ohlfsen View Post
    The advice from Tvt204 did the trick. Weird but it works. Thanks Tvt204.
    You wouldn't have to do that if you explicitely ran qmake in the example directory prior to starting the build.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  11. #11
    Join Date
    Feb 2010
    Posts
    4
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    Windows

    Default Re: Why is this so hard. (Building examples)

    Quote Originally Posted by wysota View Post
    You wouldn't have to do that if you explicitely ran qmake in the example directory prior to starting the build.
    Tried that with no luck. Ran the qmake in the subdir of the specific sample than i want to build form Creator.

Similar Threads

  1. Prblem in Building and running Examples.
    By Tarun in forum Qt Programming
    Replies: 1
    Last Post: 21st January 2010, 13:45
  2. Replies: 0
    Last Post: 31st December 2009, 09:31
  3. it's hard to animate item
    By ensky_cy in forum Qt Programming
    Replies: 5
    Last Post: 8th December 2009, 12:23
  4. vary hard problem to solve
    By FS Lover in forum Newbie
    Replies: 3
    Last Post: 2nd July 2009, 09:26

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.