1

According to this answer, the intended way to include non-header-only parts of Boost into a Visual Studio 2010 project require the use of bjam to build the correct libraries.

What is unclear to me is whether this is a one-time-only thing, where I just check in the lib files produced by bjam, or whether anyone who wants to build my project will from now on require not only Visual Studio but also bjam.

The project only targets Windows 32-bits, because it builds a plugin for a program that's only available in this configuration, and only needs to support the statically-linked multi-threaded CRT.

(For the record, if I just include the relevant .cpp files into the build, the compile stage succeeds, but at link stage I get a missing library error, which is apparently caused by the "auto-link" feature. Perhaps I should just disable auto-linking, if it's possible?)

Community
  • 1
  • 1
Roman Starkov
  • 59,298
  • 38
  • 251
  • 324

3 Answers3

3

You don't need bjam. Like yasouser answered, you can download the installer from boost pro, the downsides being that

  • you need to register though that's quick and easy
  • it's usually/sometimes a release or two behind the latest boost release.

What is unclear to me is whether this is a one-time-only thing, where I just check in the lib files produced by bjam, or whether anyone who wants to build my project will from now on require not only Visual Studio but also bjam.

It is a one time thing per machine. Once you have the boost binaries you don't need bjam anymore. The nice thing about the installer is that you can install some selected versions of the boost libraries + the headers (You can select VS version, single-threaded, static/dynamic, etc. on a per library basis e.g. thread, system, etc.) and then at a later point you can just run the installer again and add other binaries.

So if you're auto-linking and are missing a specific lib, just run the installer again. FYI, you can disable boost's autolinking option by defining BOOST_ALL_NO_LIB and then manually linking in the lib versions you want.

Ralf
  • 9,405
  • 2
  • 28
  • 46
  • One time thing _per machine_ is exactly what I was trying to avoid. `BOOST_ALL_NO_LIB` did the trick though! – Roman Starkov Mar 28 '11 at 01:31
  • @romkyns, sorry, I just re-read your question now, missed the part about checking in libs somehow (it was late last night :P), the bjam build *is* a one-off thing, provided that you are using the same VC runtimes on all machines. I prefer like yasouser to just install the binaries using the boost installer on a new machine. Feel free to unselect the answer :) – Ralf Mar 28 '11 at 04:51
  • it's an open-source project that might be compiled by people whose programming experience is minimal. Moreover, every dependency that needs to be installed before I can hit "build" halves the chances that I will actually go through with it... So I prefer BOOST_ALL_NO_LIB :) – Roman Starkov Mar 29 '11 at 10:45
1

Some of the boost libraries require you to build them as static or shared libraries and link them in your project. Either you can download the source and build it for yourself using bjam or you can install the pre-built binaries from here.

Yes this is a one time install (if you are installing from pre-built binaries or built by yourself). And those building your project will also need to do the boost install once for them to be able to build your project.

yasouser
  • 5,113
  • 2
  • 27
  • 41
  • Thanks, but I already know that much. I want to include the cpp files directly into my project instead. – Roman Starkov Mar 27 '11 at 19:35
  • you said in your question that this was "unclear" to you. Now you "already know" it. It's kind of hard to answer your question when even you apparently don't know what it is you want answered. – jalf Mar 27 '11 at 19:42
  • @jalf, @yasouser - ouch, sorry, I was referring to the first paragraph, and somehow missed the "one time install" thing... (although, more importantly, it's a once-per-machine thing, which is unacceptable in this case) – Roman Starkov Mar 28 '11 at 01:30
0

if I just include the relevant .cpp files into the build

Direct including cpp files has many drawbacks. The only reason of borrowing .cpp files I can imagine is to allow build the project on other PCs without installing boost there. But I think it can be solved by distributing particular boost .lib files as well.

alehro
  • 2,198
  • 2
  • 25
  • 41