Bug #14652 2008-10-08 02:47
kbluck
Precompiling headers using GCC incorrect command line
Attempting to use precompiled headers with GCC on Linux. The header to be compiled intto a GCH target is selected for compilation in the project, but not for linking.
The command-line which is generated by Code::Blocks during the build is:
g++ -Wall -g -Winvalid-pch -include "lib/precompile.hpp" -c /lib/precompile.hpp -o lib/precompile.h.gch
This produces a notification from GCC:
g++: lib/precompile.hpp: linker input file unused because linking not done
... and the precompile.h.gch target is not generated.
It appears that the command-line option "-x c++-header" is not being inserted into the GCC command line to inform the compiler that it is generating a precompiled header rather than an obj.
If you manually add that option before the -c option the compile succeeds, producing the expected .gch file.
- Category
- Compiler
- Group
- Status
- Open
- Close date
- Assigned to