Re: How to use precompiled header?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hei Chan <structurechart@xxxxxxxxx> writes:

> I think that I am getting close:
>
> cc1plus: warning: /opt/3rdPartyLib/src/A/B.h.gch: not a PCH file
>
>
> B.h.gch is generated by the 3rd party make script.  When I ran the make script, it output something like:
> g++  -fPIC -O -O3 -DUSING_PCH -D_REENTRANT -I"/usr/local/include/boost" -I"/usr/local/." -I"../src" -I"/opt/xerces-c-3.1.1/src" -c -o A/B.h.gch A/B.cpp
>
> Not sure whether it used -o instead of -x causing the problem.
>
> Any suggestion?

That is compiling a .cpp file, not a .h file.  gcc will not generate a
PCH file if you compile a .cpp file, it will generate an object file.

If that .cpp file is really a header file with an unusual name, then
you can use the -x c++-header option to get gcc to generate a PCH.

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux