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
I had the same problem. My resolution is - implement all virtual functions and all slots declarations.
This happens to me because I make a declaration in the header file, then delete the function in the cpp file and I forget to delete the decleration in the header. For example...
This error may also occur because of problems with linkage, for example, you forgot to declare some static variables from header file using 'extern' directive.
In my case it was declaring the clear virtual function.