:: 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.
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.
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!
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.
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?
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.
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.
Re: :: error: collect2: ld returned 1 exit status (Windows 7, Qt Creator 4.7)
Quote:
Originally Posted by
Halordain
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).