cc1plus.exe: warning: ./wx_pch.h.gch/Debug_wx_pch_h_gch: not used because `__NO_INLINE__' not defined [-Winvalid-pch]
I know its an old post, but thats what I found googling the issue. As the root cause is so stupid I do not want to spent much time on it again when I am going to run into it next time.
Root Cause:
There is nothing CB can do about it, its a GCC problem.
The warning happens when
-Winvalid-pch is configured to warn about PCH issues. Since all PCHs could be in the same folder, GCC puts the BuildTarget name into them to keep them apart, e.g. "xxxReleasexxxx" or "xxxDebugxxxx". Compiling "Debug" will be fine. But when you compile "Release" gcc looks into the folder for 'gch'' files and first finds the "Debug" version. Since this is not the correct one it prints the warning. Only then it looks for the next file and finds the correct "Release" version. So it continues to compile with no further warnings. The code will run fine.
The result is a flood useless warnings for any Release build, but none for the Debug build. Maybe there is an architectural reason why they can not look for other fiiles first and then throw the warning, but so we get yet another confusing gcc warning.
There are two wys to sove this
1. Put the PCH files into separate folders. Only the middle C::B option will do that
2. The alternative is to not use
-Winvalid-pch compiler switch