Re: [eigen] on CoreDeclarations

[ Thread Index | Date Index | More Archives ]

On Thu, Aug 28, 2008 at 3:09 PM, Benoît Jacob <jacob@xxxxxxxxxxxxxxx> wrote:
> Do you know if g++ has the precompiled-headers feature? Is that easy to use in
> the context of a cmake/make/g++ project?

that's easy, create a file (with the .h extension, mandatory):

#include <Eigen/Core>
#include <another_stable_header_used_everywhere_in_my_project>

g++  -c CXXFLAGS path/to/MyPCH.h

at this point when gcc see : #include "MyPCH.h" it will use the
respective precompiled header file (the optimization/debug flags
*must* be the same)

So in practice you have to include the file MyPCH.h *before* the other
headers (gcc has also an option to specify additional files to

you can have only one precompiled header file.

I managed to use PCH with cmake/g++ on my project, so that's doable !!
(I found some helper cmake module for that, but maybe cmake 2.6 has
some more builtin and cleaner support...)


Mail converted by MHonArc 2.6.19+