RE: How to use pre-compiled headers with gcc version 3.2.2

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

 



-----Original Message-----
From: lapo_pasqui@xxxxxxxxx [mailto:lapo_pasqui@xxxxxxxxx] 

> 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


[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