User forums > Using Code::Blocks
Does not recompile changed header files?
Decrius:
Hey,
I am working on a library, I don't want to recompile everything every time...takes too much time.
Sometimes, if I only changed some code in the header file (typically template functions), it doesn't recompile it if I press Ctrl + F9. I _must_ press Ctrl + F11 to make it work. Is there a way CodeBlocks also recognises header file changes and recompiles them if needed?
Thanks.
thomas:
Works fine for me as long as the headers are added to the project. If they are not part of the project, they are not recompiled, because changes are not saved to disk when you hit "build". That, however, is intentional.
Decrius:
--- Quote from: thomas on January 14, 2009, 02:48:47 pm ---Works fine for me as long as the headers are added to the project. If they are not part of the project, they are not recompiled, because changes are not saved to disk when you hit "build". That, however, is intentional.
--- End quote ---
I have them added to the project, but changes to the header files doesn't always make it recompile correctly.
rhf:
Decrius,
I don't know if this is your case, but I had a similar problem; that is, a modification in a header file in the project did not cause a recompilation.
In my case I was setting my library path in Settings->Compiler and debugger->Global compiler settings->Search directories.
Everything seemed to work - the modified header file was saved as expected, but the program was not recompiled. I had to do a Rebuild (Ctrl-F11) to force a re-compilation. (I believe this is a bug.) To solve this problem I moved my library path to the Project->Build options->Search directories.
Also, occasionally I would have problems when debugging, and this seemed to go away when I always use the absolute (as opposed to relative) path in the Project->Build options->Search directories.
ollydbg:
--- Quote from: rhf on January 22, 2009, 07:33:11 pm ---Decrius,
I don't know if this is your case, but I had a similar problem; that is, a modification in a header file in the project did not cause a recompilation.
--- End quote ---
I don't have the problem( I just tested yet), make sure your header file was include in your project as thomas said.
--- Quote ---Also, occasionally I would have problems when debugging, and this seemed to go away when I always use the absolute (as opposed to relative) path in the Project->Build options->Search directories.
--- End quote ---
What's your problem when debugging? Absolute path is recommended in compiling if you want to debug using GDB.
Navigation
[0] Message Index
[#] Next page
Go to full version