Are precompiled headers supported by gcc 3.3.3?

Are precompiled headers supported on gcc 3.3.3?

If so, what syntax generates and uses precompiled headers in Linux with gcc 3.3.3. We cross our projects on Windows and Linux, on Windows we precompile stdafx.h and I am learning how to set it up to be precompiled on Linux.

I know gcc doc , I am looking for an actual solution.

In gcc 3.3.3, I get this:

> gcc stdafx.h
gcc: compilation of header file requested

      

And finally, if it worked, what would be the name of the generated file?

EDIT . Precompiled headers do not seem to be supported in gcc 3.3.3, and on a newer version of gcc the generated file is named with a .gch extension.

0


a source to share


3 answers


I don't know which version of gcc supports it from, but in order to use them, just read the gcc documentation .

Anyway, gcc 3.3.3 is pretty old too. Maybe there is a chance that you can upgrade to the newer 4.X version? This should support recompiled headers.

Perhaps you could try the latest 3.X GCC (GCC 3.4.6). I'm guessing the ABI gap is from 3.X to 4.X, so 3.4 might be compatible. I think it's worth checking out.



from http://gcc.gnu.org/gcc-3.4/changes.html

C / Objective-C / C ++
Precompiled headers are now supported.

+1


a source


I'm not entirely sure if GCC 3.3 supports it, but precompiling headers are actually no different from creating objects, at least as of GCC 4.x:

gcc $CFLAGS header.h

      



It will create a new precompiled header next to the .h file and automatically use it when it #include

d.

0


a source


I don't remember if it is supported in gcc 3.3.3. The output file will be {filename.ext} .gch

0


a source







All Articles