3

Based on this excellent tutorial, I am able to build the boost library without problems. However, I cannot find any PDB files are generated.

boost_1_49_0>b2 --prefix=c:\temp\boost1.49 --toolset=msvc-10.0 --build-type=complete

Since I have built .lib and .dll files for boost. what else minimum build I should do in order to get all corresponding pdb generated?

Community
  • 1
  • 1
q0987
  • 34,938
  • 69
  • 242
  • 387

2 Answers2

8

From "Built in Features"

When you call b2 try using --debug-symbols=on

dB8
  • 176
  • 5
  • I have tried the following command `b2 --toolset=msvc-10.0 --build-type=complete debug-symbols=on debug-store=database`. However, after it finishes buiding, PDBs are not copied to a specific folder? why? – q0987 Apr 12 '12 at 17:49
  • I will give it a try while I hack away at something else. Let you know if I come up with anything. – dB8 Apr 12 '12 at 19:27
  • It seems that pdb are made durring the build, but they are not copied from the build directories. You could do a search for *.pdb in the build directory and copy all the relevant pdbs into the prefix\lib directory. (I am assuming that they are proper and compatible with the compiled libraries, though that could be a faulty assumption.) To get them copied over during the normal course of the instillation would require a lot of altering of the b2 config files. – dB8 Apr 12 '12 at 22:42
  • Link is broken, for Boost 1.67.0 you can find them [here](https://www.boost.org/doc/libs/1_67_0/doc/html/bbv2/reference.html#bbv2.overview.builtins.features), fur 1.68.0 the location has moved already. – Brandlingo Aug 24 '18 at 10:03
  • [Here](https://boostorg.github.io/build/manual/develop/index.html#bbv2.overview.builtins.features) is the documentation in Boost's git repo. – Brandlingo Aug 24 '18 at 10:09
2

You can build pdbs for static libs directly in the necessary directory (which may be needed for the debugger) by a little tweaking of msvc.jam. Find rule archive there and change

PDB_NAME on $(>) = $(<[1]:S=.pdb) ;

to e.g.:

PDB_NAME on $(>) = "c:\\Lib\\boost\\stage\\lib\\$(<[1]:S=.pdb:G=)" ;

(Disclaimer: I have only a vague idea what that cryptic expression means, never saw it documented anywhere, it was a pure guesswork on my part, hence no guarantees, but it works for me).

PDBs for DLLs are built by the linker, so you may set its option in e.g. project-config.jam:

import toolset ;
using msvc ;
toolset.flags msvc.link LINKFLAGS <link>shared : "/PDB:c:\\Lib\\boost\\stage\\lib\\" : unchecked ;

I'm sure there's a way to get the output directory from the system automatically. If anyone figures that out, please update.

panda-34
  • 4,089
  • 20
  • 25