Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: oBFusCATed on January 24, 2010, 02:55:23 pm

Title: Missing cpp file doesn't break the build?!
Post by: oBFusCATed on January 24, 2010, 02:55:23 pm
I renamed a .cpp file outside C::B, then I've rebuild the project and the build succeeded.

Here is part of the log:
Code
WARNING: Can't read file's timestamp: /home/obfuscated/projects/myproj/myfile.cpp

Is it possible to make the build fail in this kind of situations?
I can do it, if the patch will be accepted.

Title: Re: Missing cpp file doesn't break the build?!
Post by: MortenMacFly on January 24, 2010, 03:30:18 pm
I renamed a .cpp file outside C::B, then I've rebuild the project and the build succeeded.
Well, if the build succeeded it means that this file is actually not needed. So why set the build as failed? If the file would really be needed the linker would complain and the build would fail, indeed. Can you clarify why this should be an error?
Title: Re: Missing cpp file doesn't break the build?!
Post by: Jenna on January 24, 2010, 03:49:46 pm
It also succeeds if the appropriate object-file remains and can be linked.
Title: Re: Missing cpp file doesn't break the build?!
Post by: oBFusCATed on January 24, 2010, 04:19:02 pm
It also succeeds if the appropriate object-file remains and can be linked.
This is my case.
Is it possible to make this error?
Title: Re: Missing cpp file doesn't break the build?!
Post by: MortenMacFly on January 24, 2010, 04:43:34 pm
Is it possible to make this error?
What about a warning like:
"Warning: Probably linking against an obsolete object file (source file not accessible anmyore)."
Because probably you only have the object file. And then it wouldn't be an error.
Title: Re: Missing cpp file doesn't break the build?!
Post by: oBFusCATed on January 24, 2010, 05:33:11 pm
At the moment it is a warning (not showing in the build messages by the way),
I want it to be error, because if you hit "Rebuild All" the build will fail with:

Code
g++: .obj/tests/debug/src/myfile.o: There is no such file or directory

If it is an error, C::B would detect the problem (the source file is missing) earlier.

Because probably you only have the object file. And then it wouldn't be an error.
This is another case and should be handled differently -> you add the object file to the project or in the Linker settings (the former looks more like the correct way).