Results 1 to 8 of 8

Thread: :: error: collect2: ld returned 1 exit status (Windows 7, Qt Creator 4.7)

  1. #1
    Join Date
    Feb 2011
    Posts
    5
    Platforms
    Windows

    Default :: error: collect2: ld returned 1 exit status (Windows 7, Qt Creator 4.7)

    Hi,

    Using Qt Creator 4.7 (fresh download SDK out of box), I cannot build a project that builds fine in both VC++ Express 2008 and VS 2010. I had to remove hash_map<> and change it to the more standard map, and , still, I receive this error message:

    Compile output looks like this:

    Starting: "C:/Qt/mingw/bin/mingw32-make.exe" -w
    mingw32-make: Entering directory `C:/Qt/ChessBW-build-desktop'

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

    mingw32-make[1]: Entering directory `C:/Qt/ChessBW-build-desktop'

    g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\ChessBW.exe object_script.ChessBW.Debug -L"c:\Qt\lib" -L"c:\Qt\lib" -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4

    mingw32-make[1]: Leaving directory `C:/Qt/ChessBW-build-desktop'

    mingw32-make: Leaving directory `C:/Qt/ChessBW-build-desktop'

    Warning: .drectve `/manifestdependency:"type='win32' name='Microsoft.VC90.DebugCRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"msvcprtd" /manifestdependency:"type='win32' name='Microsoft.VC90.DebugCRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'" /DEFAULTLIB:"MSVCRTD" /DEFAULTLIB:"OLDNAMES" ' unrecognized

    c:\Qt\lib/qtmaind.lib(tmp/obj/debug_shared/qtmain_win.obj):(.text[?realloc@?$QVector@PAD@@AAEXHH@Z]+0x19): undefined reference to `__security_cookie'

    c:\Qt\lib/qtmaind.lib(tmp/obj/debug_shared/qtmain_win.obj):(.text[?realloc@?$QVector@PAD@@AAEXHH@Z]+0x240): undefined reference to `_CxxThrowException@8'

    c:\Qt\lib/qtmaind.lib(tmp/obj/debug_shared/qtmain_win.obj):(.text[?realloc@?$QVector@PAD@@AAEXHH@Z]+0x3b1): undefined reference to `_CxxThrowException@8'

    c:\Qt\lib/qtmaind.lib(tmp/obj/debug_shared/qtmain_win.obj):(.text$x+0xd): undefined reference to `@__security_check_cookie@4'

    c:\Qt\lib/qtmaind.lib(tmp/obj/debug_shared/qtmain_win.obj):(.text$x+0x17): undefined reference to `__CxxFrameHandler3'

    c:\Qt\lib/qtmaind.lib(tmp/obj/debug_shared/qtmain_win.obj):(.data[??_R0?AVbad_alloc@std@@@8]+0x0): undefined reference to `??_7type_info@@6B@'

    collect2: ld returned 1 exit status

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

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

    The process "C:/Qt/mingw/bin/mingw32-make.exe" exited with code %2.
    Error while building project ChessBW (target: Desktop)
    When executing build step 'Make'


    I looked in other threads, but all of the responses propose things I cannot do. Typing in qmake into a terminal (I don't have a terminal in Windows 7), checking mingw32, changing the path to gcc to 4.4... I have no idea where to do these things from Qt Creator, which does not appear to have any knob where I can just switch or check these things. Please help!

    Thanks.

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

    Default Re: :: error: collect2: ld returned 1 exit status (Windows 7, Qt Creator 4.7)

    It seems you are using a makefile or a .pro file designed specifically for VS. Just look at the warnings related to VS runtime libraries. Run qmake, mingw32-make distclean, qmake and mingw32-make.
    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.


  3. #3
    Join Date
    Feb 2011
    Posts
    5
    Platforms
    Windows

    Default Re: :: error: collect2: ld returned 1 exit status (Windows 7, Qt Creator 4.7)

    "Run qmake, mingw32-make distclean, qmake and mingw32-make."

    Thank you for your prompt reply, but...

    ...how do I "run"? I found a qmake EXE file in the Qt folder, and double-clicked on it, to no avail. Nothing happened. I couldn't find other executables.

    As I said before, I'm not working in a terminal-ready environment, since I'm in Windows 7, so I can't just call up a linux kernel, navigate to some folder, and type run. I also don't know where the mingw32-make distclean executable is located. Please elaborate.

    Thanks!

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: :: error: collect2: ld returned 1 exit status (Windows 7, Qt Creator 4.7)

    Qt Creator Build menu, Rebuild All. Or do it step at a time Clean All, Run qmake, Build All.

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

    Default Re: :: error: collect2: ld returned 1 exit status (Windows 7, Qt Creator 4.7)

    Or open "Qt Command Prompt" from start menu and learn something else than clicking icons. Are you a developer or a luser?
    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
    Feb 2011
    Posts
    5
    Platforms
    Windows

    Default Re: :: error: collect2: ld returned 1 exit status (Windows 7, Qt Creator 4.7)

    What an elitist remark. Not everybody knows the location of every function and command from birth.

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

    Default Re: :: error: collect2: ld returned 1 exit status (Windows 7, Qt Creator 4.7)

    It's not about "every" unction or command. It's about principles of doing things. If you know how to use command line in general, it won't be a problem for you to type yet another command, especially if someone points you to it.
    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.


  8. #8
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: :: error: collect2: ld returned 1 exit status (Windows 7, Qt Creator 4.7)

    Quote Originally Posted by Halordain View Post
    What an elitist remark. Not everybody knows the location of every function and command from birth.
    Correct, but I think I'll be backed up when I state that most developers know how to open a command prompt and navigate to a directory to run some commands - even if they only know a handful of such commands; because there are a LOT of development tools out there which require such an environment. Not everything can be point and click, specially when developing applications (plus a lot of developers hate using the mouse, as it is so infrequently used).

Similar Threads

  1. collect2: ld returned 1 exit status
    By qtnewbie123 in forum Installation and Deployment
    Replies: 9
    Last Post: 12th July 2011, 18:51
  2. Collect2:Id Returned 1 exit status
    By c_srikanth1984 in forum Qt Programming
    Replies: 9
    Last Post: 14th February 2010, 04:58
  3. error: collect2: ld returned 1 exit status
    By srohit24 in forum Qt Programming
    Replies: 3
    Last Post: 1st December 2009, 06:32
  4. error: collect2: ld returned 1 exit status
    By nataly in forum Qt Programming
    Replies: 4
    Last Post: 13th October 2009, 13:39
  5. collect2: ld returned 1 exit status error
    By gmsk19 in forum Qt Tools
    Replies: 11
    Last Post: 25th July 2009, 02:05

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.