Boost logo

Boost-Build :

From: Bojan Resnik (resnikb_at_[hidden])
Date: 2005-12-07 07:29:39


  Hi,
  I am creating a library and an exe that links to it. Both of these
use their own precompiled headers (latest from CVS) and with MSVC in
debug mode I get linker error on the exe: LNK1211: precompiled type
information not found; 'filename' not linked or overwritten.

  This occurs because none of the object files reference symbols from
the precompiled header, and so the linker does not fetch the
precompiled obj from the library. The debug information contained in
the precompiled obj cannot be found in that case.

  The MS recommended solution is to use /Yl switch in addition to /Yc
when creating the precompiled header. I have modified msvc.jam by
adding
/Yl__bjam_symbol option to the compile.pch action. This solved the
problem and seems to work correctly even with multiple libraries
having their own precompiled headers.

--
Bojan Resnik
Index: msvc.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/msvc.jam,v
retrieving revision 1.69
diff -u -r1.69 msvc.jam
--- msvc.jam	6 Dec 2005 08:28:02 -0000	1.69
+++ msvc.jam	7 Dec 2005 12:28:20 -0000
@@ -597,7 +597,7 @@
 actions compile.pch bind PCH_SOURCE
 {
-    $(.CC) /Zm800 -nologo -TP -U$(UNDEFS) $(CFLAGS) $(C++FLAGS)
$(USER_CFLAGS) @"@($(<[1]:W).rsp:E=$(nl)"$(PCH_SOURCE:W)"
$(nl)-D$(DEFINES) $(nl)"-I$(INCLUDES)")" -c -Fo"$(<[1]:W)"
/Yc"$(>[1]:D=)" -Fp"$(<[2]:W)"
+    $(.CC) /Zm800 -nologo -TP -U$(UNDEFS) $(CFLAGS) $(C++FLAGS)
$(USER_CFLAGS) @"@($(<[1]:W).rsp:E=$(nl)"$(PCH_SOURCE:W)"
$(nl)-D$(DEFINES) $(nl)"-I$(INCLUDES)")" -c -Fo"$(<[1]:W)"
/Yc"$(>[1]:D=)" /Yl__bjam_pch_symbol -Fp"$(<[2]:W)"
 }

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