Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QtCreator build returns collect2: ld returned exit status 1

Tags:

c++

ld

qt-creator

While building several different projects in QtCreator, I have run across the following build error:

collect2: ld returned 1 exit status

After only changing a few things (that should not change anything significant in the build), it will go away if it has already appeared, or it will appear if it's not there.

In my current program for a school project, I am trying to compile rock03.cpp. It's the only file in the build, and has the main() method. I had just run it successfully, and went back to change the order of some if()s, now, I get only two relevant warnings:

overriding commands for target 'rock03.o'

and

ignoring old commands for target 'rock03.o'

along with the error in question.

Does anyone know why this would happen? I cannot seem to reproduce the error with any reasonable certainty, and QtCreator is not complaining about any thing before I build.

Thanks

like image 824
Austin Hyde Avatar asked Sep 28 '09 03:09

Austin Hyde


1 Answers

If the only message error is this one concerning linker, the reason can be that your program is still running and linker can not access to the binary file. Be sure your application was stopped or kill it if still running. Qtcreator never checks if previous run was stopped before compiling.

like image 186
Patrice Bernassola Avatar answered Sep 30 '22 15:09

Patrice Bernassola