Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Collect2: ld returned 1 exit status
Forum Updated to NodeBB v4.3 + New Features

Collect2: ld returned 1 exit status

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 6.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Miikukka
    wrote on last edited by
    #1

    Every times when I try to run something it says that. In Compile Output read @Running build steps for project Testi...
    Configuration unchanged, skipping qmake step.
    Starting: "C:/QtSDK/mingw/bin/mingw32-make.exe" -w
    mingw32-make: Entering directory `C:/Users/Miika/QT sovellukset/Testi-build-desktop'

    C:/QtSDK/mingw/bin/mingw32-make -f Makefile.Debug

    mingw32-make[1]: Entering directory `C:/Users/Miika/QT sovellukset/Testi-build-desktop'

    g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\Testi.exe debug/main.o debug/testi.o debug/moc_testi.o -L"c:\QtSDK\Simulator\Qt\mingw\lib" -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4 -LC:\OpenSSL-Win32_full\lib

    debug/moc_testi.o:C:\Users\Miika\QT sovellukset\Testi-build-desktop/debug/moc_testi.cpp:74: undefined reference to `Testi::on_pushButton_2_clicked()'

    debug/moc_testi.o:moc_testi.cpp:(.rdata$_ZTV5Testi[vtable for Testi]+0x4c): undefined reference to `QWidget::getDC() const'

    debug/moc_testi.o:moc_testi.cpp:(.rdata$ZTV5Testi[vtable for Testi]+0x50): undefined reference to `QWidget::releaseDC(HDC_*) const'

    debug/moc_testi.o:moc_testi.cpp:(.rdata$_ZTV5Testi[vtable for Testi]+0xb8): undefined reference to `QWidget::winEvent(tagMSG*, long*)'

    debug/moc_testi.o:moc_testi.cpp:(.rdata$_ZTV5Testi[vtable for Testi]+0x104): undefined reference to `non-virtual thunk to QWidget::getDC() const'

    debug/moc_testi.o:moc_testi.cpp:(.rdata$ZTV5Testi[vtable for Testi]+0x108): undefined reference to `non-virtual thunk to QWidget::releaseDC(HDC_*) const'

    collect2: ld returned 1 exit status

    mingw32-make[1]: Leaving directory `C:/Users/Miika/QT sovellukset/Testi-build-desktop'

    mingw32-make[1]: *** [debug\Testi.exe] Error 1

    mingw32-make: Leaving directory `C:/Users/Miika/QT sovellukset/Testi-build-desktop'

    mingw32-make: *** [debug] Error 2

    The process "C:/QtSDK/mingw/bin/mingw32-make.exe" exited with code %2.
    Error while building project Testi (target: Desktop)
    When executing build step 'Make'@
    I think the problem is in Qt or somewhere because it comes in every project.
    What I must do, and what's wrong?
    Thanx and sorry my bad English, I'm Finnish beginner.

    There are no stupid questions, only stupid answers.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      Did you

      • add Q_OBJECT macro to your QObject derived classes (including QWidget derived classes)
      • declare slots with "public slots:" instead of "public:" (the same for proteced/private)
      • re-run qmake and rebuild you project from scratch

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Miikukka
        wrote on last edited by
        #3

        Yes.
        What I must declare?
        Yes.

        Now I made project again and now it works. WTF

        Thank you.

        There are no stupid questions, only stupid answers.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved