This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: How to use pre-compiled headers with gcc version 3.2.2
- From: lrtaylor at micron dot com
- To: <lapo_pasqui at libero dot it>, <gcc-help at gcc dot gnu dot org>
- Date: Wed, 8 Oct 2003 15:52:43 -0600
- Subject: RE: How to use pre-compiled headers with gcc version 3.2.2
-----Original Message-----
From: lapo_pasqui@libero.it [mailto:lapo_pasqui@libero.it]
> Looking further at the documentation, I should provide the compiler
the -x
> switch as a hint to the compiler about the syntax to be used.
> I'm happy with this solution and this is what I get
> > gcc -c -x c foo.h
> > file foo.o
> foo.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not
> stripped
> Surprisingly a get an object file. Is this correct?
Yes, this is correct, because "-x c" tells the compiler to treat the
file as a C source file rather than what the default would be based on
the file's extension. So, you're getting the same result you would get
if you renamed the file "foo.c" and compiled it using "gcc -c foo.c",
which is the expected behavior.
Sorry I can't help you for the precompiled headers, though...
Cheers,
Lyle Taylor