News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Build force to compile all cpp's

Started by Sagaceil, September 23, 2014, 11:04:28 PM

Previous topic - Next topic

Sagaceil

Hi !

I'm dealing with some anoying issue. When I do some minor change in one cpp file, and try to build project it recompiles all cpp units. I have proper PCH file (as said here http://wiki.codeblocks.org/index.php?title=Precompiled_headers , with generated gch file ).

Does something need to be set in C::B or in build setting ? Its really paint in the ass to wait several minutes and see how ~800 cpp's are compiling just to check little change :p

Thanks for any help !

stahta01

#1
If you change only what is in a cpp file then you should NOT have to build all the cpp files.
NOTE: If you change what is included inside a header than every file that includes that header needs to be recompiled.

Did not read the PCH info on link; but, you should know that much of the info on the web is incomplete.

MinGW GCC only uses a PCH file with included first thing in a compilation unit!
This means including a PCH file from inside a header is a waste of time!.
Edit: It also means you can NOT include another file before the PCH file.

Some #pragmas can NOT be before the including of a PCH file.

NOTE: Some headers can NOT be included inside a PCH file because the header does some operations not supported by MinGW GCC.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Sagaceil

Yup, I have arleady setup all the things you mentioned : the very first include in every cpp, classic #ifndef/endif guards, no PCH includes in any headers (only cpp's). Choosing proper PCH location in Build Options makes different (using 'Generate PCH in a directory alongside the original file' speeds up like 2x, so somehow PCH works).


-------------- Buduj: EditorFull in BarokEngine (compiler: GNU GCC Compiler)---------------

[  0.0%] Pre-compiling header: build.h

.... another gazilion cpp units ;P

[100.0%] Konsolidacja plik wykonywalny: HostApp.exe


As I imagine, there should be only that cpp files in the log that were actually changed ? I'm aware of changing header file forces the recompile all dependcies.

stahta01

Are you positive you are doing build instead of rebuild?

If you do a second build right after the first, does it say nothing to be done or what?

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

oBFusCATed

Just a note: When asking for help it is best to post logs and error messages in english and not in your native language... The chance for someone to help you is quite a lot higher.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Jenna

You might get such issues, if you have your files on a network server with different time settings.

Sagaceil

#6
Quote from: oBFusCATed on September 24, 2014, 01:19:58 AM
Just a note: When asking for help it is best to post logs and error messages in english and not in your native language... The chance for someone to help you is quite a lot higher.
Yeah, sorry for that, just quickly copy-pasted it. Didn't noticed that language changed ;) The last log at [100%] is just simply telling that now is linker time ;)

Quote from: jens on September 24, 2014, 05:58:54 AM
You might get such issues, if you have your files on a network server with different time settings.
Its not the case here. But I've checked timestamps and headers doesn't changed at all. Even turned autosave for sure.

Quote from: stahta01 on September 24, 2014, 12:01:39 AM
Are you positive you are doing build instead of rebuild?
If you do a second build right after the first, does it say nothing to be done or what?
Yes, I'm sure ;) Should there will be promnt to ask to build project when using Run after the code changed ?