Boost logo

Boost-Build :

From: Andrei Melnikov (andy.melnikov_at_[hidden])
Date: 2006-10-26 20:45:38


On 24/10/06, Daniel Lidström <daniel.lidstrom_at_[hidden]> wrote:
> Vladimir Prus scribbled:
>
> > Hi,
> > I've just committed the attached patch, which makes PCH work on msvc
> > without requiring a .cpp file -- the .cpp file will be
> > created automatically.
>
> It would be nice if it was possible to put the precompiled header in a
> subdirectory.
> For example, here is what I tried to do (my sources are in GFL/):
>
> # Pre-compiled header
> cpp-pch PreCompile
> : GFL/PreCompile.h
> : <toolset>msvc:<source>GFL/PreCompile.cpp
> ;
>
> lib GFL-1_0
> : PreCompile # Pre-compiled header
> ...
> ;
>
> This works with gcc toolset, but not msvc. The problem is that I include
> "GFL/PreCompile.h"
> in all cpp-files but the compiler switch is -Yu"PreCompile.h". It has to be
> -Yu"GFL/PreCompile.h".
> Otherwise the compiler complains:
>
> compile-c-c++ bin\msvc-7.1\debug\threading-multi\Alignment.obj
> Alignment.cpp
> C:\projects\trunk\GFL\GFL\LandXML\Alignment.cpp(139) : fatal error C1010:
> unexpected end of file while looking for precompiled header directive
>
Try to use just #include "PreCompile.h", not #include
"GFL/PreCompile.h" in your files. MSVC violates header searching rules
for precompiled headers.

-- 
Andrei

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk