User forums > General (but related to Code::Blocks)

Debug_wx_pch_h_gch: not used because `__NO_INLINE__' not defined [-Winvalid-pch]

(1/1)

eranon:
Hello. I'm getting this warning during release building :


--- Quote ---cc1plus.exe: warning: ./wx_pch.h.gch/Debug_wx_pch_h_gch: not used because `__NO_INLINE__' not defined [-Winvalid-pch]

--- End quote ---
So, I suppose compiler complains about use of debug version of precompiled file for a release build... But why ? Where to change this through C::B, please ?

MortenMacFly:

--- Quote from: eanon on May 21, 2012, 08:43:44 pm ---Where to change this through C::B, please ?

--- End quote ---
Choose to put the PCH headers into the object's output folder in the project settings and select a different object output folder for the release/debug target (which you have to do anyways, btw...).

eranon:
OK, solved, Morten : thanks (it will become an habit). I've deleted previous dir containing the wx_pch.h.gch's and changed the "precompiled stategy" in project settings as you said... So, now, zero warning  : cool ;)

tigerbeard:

--- Quote ---cc1plus.exe: warning: ./wx_pch.h.gch/Debug_wx_pch_h_gch: not used because `__NO_INLINE__' not defined [-Winvalid-pch]

--- End quote ---

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



Navigation

[0] Message Index

Go to full version