User forums > Using Code::Blocks

Used to auto-build when adding new files, but not anymore?

<< < (2/3) > >>

MortenMacFly:
Hmmm... btw: It works for me on Windows. What I've done:

- Create a hello world console project
- compile & run (using F9)
- remove the "main.cpp" file from the project
- rename it on the disc to "main2.cpp" and changed some content (not using C::B)
- added "main2.cpp" to the project
- hit F9 and it compiles / links just fine.

MortenMacFly:

--- Quote from: MortenMacFly on December 09, 2015, 08:55:11 pm ---Hmmm... btw: It works for me on Windows. What I've done:

- Create a hello world console project
- compile & run (using F9)
- remove the "main.cpp" file from the project
- rename it on the disc to "main2.cpp" and changed some content (not using C::B)
- added "main2.cpp" to the project
- hit F9 and it compiles / links just fine.

--- End quote ---

Is that what you did as well? Did I miss a step?

And btw: If I re-add "main.cpp" and remove "main2.cpp" it will not compile. But this is as expected because the related object file (main2.obj) is newer than the sourc file...

I assume you have an object file with the same name in place that is newer than the source file you add.

oBFusCATed:
You need to do the removing step twice.
1. build with main.cpp, remove it
2. build with main2.cpp, remove it
3. build with main.cpp -> builds nothing.

AntiElephant:

--- Quote from: oBFusCATed on December 09, 2015, 09:06:41 pm ---You need to do the removing step twice.
1. build with main.cpp, remove it
2. build with main2.cpp, remove it
3. build with main.cpp -> builds nothing.

--- End quote ---

Yeah this is basically what happens. It should be building main.cpp on that third step, but it doesn't - so it gets left with the executable from building with main2.cpp.

I can't tell, but, are you able to obtain this bug too oBFus?


I even uninstalled CodeBlocks, removed the config data from %USER PROFILE%/AppData, deleted and created my project again, with no luck.

It was working one day, not the next. Not sure what's happened.

oBFusCATed:

--- Quote from: AntiElephant on December 09, 2015, 11:19:39 pm ---I can't tell, but, are you able to obtain this bug too oBFus?

--- End quote ---
Yep, I have reproduced the bug.


--- Quote from: AntiElephant on December 09, 2015, 11:19:39 pm ---I even uninstalled CodeBlocks, removed the config data from %USER PROFILE%/AppData, deleted and created my project again, with no luck.

--- End quote ---
The file is not stored there. You have to either delete it from the .obj folder inside your project or just hit the rebuild project/workspace button.


--- Quote from: AntiElephant on December 09, 2015, 11:19:39 pm ---It was working one day, not the next. Not sure what's happened.

--- End quote ---
I doubt it has been working. Probably you've been doing something else.

@Morten: Probably we can delete the object file for main.cpp when the main.cpp file is added to the project. This will make sure that the file gets recompiled and the project re-linked. What do you think? But for sure this should wait for the 15.12 release to happen.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version