I have a header in my project, called Core.h, that I use as a pre-compiled header:
$(CXX) $(CXX_CFLAGS) -x c++-header Core.h
Which creates a file named Core.h.gch
*#include "Core.h"
is the first directive of every source file in the module.
On OS X, it works fine -- my project compiles fine & it compiles pretty fast.
On Linux however, 7 of my 100+ files give the following warning:
warning: Core.h.gch: too short to be a PCH file
Just like every other source file, #include "Core.h"
is the first line of these files.
Has anyone ever come across this? Possible causes? Why would it only be a few files that include the PCH that would give the warning ?
I use gcc version 4.1.2 on Linux, 4.2.1 on OSX
Thanks!
EDIT:
Here is basically how I build the library:
.PHONY: all
all: $(MY_PCH) MYLIB.so MYLIB.a
MYLIB.so: $(MY_PCH) $(MY_OBJECTS)
$(CXX) $(MY_OBJECTS) $(CXX_LDFLAGS) -o $@
MYLIB.a: $(MY_PCH) $(MY_OBJECTS)
$(AR) $(ARFLAGS) $@ $(MY_OBJECTS)
$(MY_PCH):
$(CXX) $(CXX_CFLAGS) -x c++-header Core.h