6

So I am trying for whole day to integrate Boost with Visual Studio (2008) on Windows 7. I firstly I went twice trough this How to use Boost in Visual Studio 2010.

I searched over all (there are at least 3 of them) simiral topics and none of them worked.

Some people proposed using this one : www.boostpro.com/download/ but link is not active. Someone proposed to change runtime library to Multi-threaded DLL but is also didnt work.

I just try to include #include <boost/thread.hpp> and got this error

fatal error LNK1104: cannot open file 'libboost_thread-vc90-mt-s-1_53.lib'.

Before installing Boost the error was that it cannot find the thread.hpp so it seems like the Boost is installed somewhat correctly.

The problem is that the libraries were not build while I was using the tutorial. How can I build them manually?

Community
  • 1
  • 1
rank1
  • 1,018
  • 4
  • 16
  • 37

4 Answers4

3

There's no such thing like one-click boost install, you still need to do something manually. In your case it seems you need to compile Boost.Thread library and then add directory where resulting .lib file is to your library path. The link you provided looks pretty good. If you followed it probably you already built Boost.Thread. Make sure you did #6 from the second part.

Andriy Tylychko
  • 15,967
  • 6
  • 64
  • 112
  • Yes, the directories are included correctly(without them the error is that thread.hpp cannot be find) – rank1 Apr 02 '13 at 14:26
  • @SebastianCygert: please be careful, it's a different directory, for libraries, not for include files. – Andriy Tylychko Apr 02 '13 at 14:32
  • I checked additional Include directories is C:\boost\include\boost-1_53\boost and libs isC:\boost\boost_1_53_0\libs – rank1 Apr 02 '13 at 14:52
  • @SebastianCygert: double check that file `libboost_thread-vc90-mt-s-1_53.lib` is in a directory that is included into your libs dirs list – Andriy Tylychko Apr 02 '13 at 14:56
  • No, I cannot find this file there (even anywhere). Another issue: when the include directory points to whole Boost directory the problem is like in the topic (cannot find .lib file) but when this directory points to boost/include like in this topic http://stackoverflow.com/questions/2629421/how-to-use-boost-in-visual-studio-2010 the error is the it cannot find thread.hpp file. – rank1 Apr 02 '13 at 15:02
  • @SebastianCygert: additional include path is a path where VC looks for your ***include files***. First VC needs to include your files to compile your program. It's why you receive "cannot file .hpp" when you add wrong dir to your additional include paths. If compiled successfully, VC tries to link your program, and now it needs boost lib which you had to compile before following that link. It cannot find it as well as you. So make sure you compiled Boost.Thread successfully first. Sorry I cannot help you anymore. A free advise - forget about Boost and first learn fundamental C++ things. – Andriy Tylychko Apr 02 '13 at 15:11
  • If U have another advise like which library to use instead of boost for asynchronous operations, sockets, mutexes I would apreciate it;) – rank1 Apr 02 '13 at 15:21
  • So it seems that the problems is with the libraries – rank1 Apr 02 '13 at 16:36
  • When building boost, there are several options for which versions (eg, static vs dynamic, multithreaded vs not) you want to build. If you want an easier library to use those sorts of things in C++, I would recommend Qt - it has some other quirks to it, but has simpler interfaces and its own IDE (Qt Creator) that makes installing and building with it lots easier. Using it from VS is a bit of work still. – Tyler Gill Apr 08 '13 at 06:41
2

There are prebuild binaries - installation packages: http://sourceforge.net/projects/boost/files/boost-binaries/1.53.0/

Aleksey Kontsevich
  • 4,671
  • 4
  • 46
  • 101
1

Use this command: bjam --build-dir=build-directory toolset=toolset-name --build-type=complete stage this build the libraries manually. Then add the new directory to additional libraries path

as it is indicated in this link: http://www.boost.org/doc/libs/1_43_0/more/getting_started/windows.html#or-build-binaries-from-source

rank1
  • 1,018
  • 4
  • 16
  • 37
1

I found this article quite helpful:

http://www.codeproject.com/Articles/11597/Building-Boost-libraries-for-Visual-Studio

  • The article explains how to build the build tool BJam (mainly by locating the boostrapper.bat)
  • How to build the libraries, e.g. bjam toolset=msvc-11.0 variant=debug threading=multi link=static (in this case the VS2012 multi-threaded, statically linked debug version).
  • It also features build batches, but I haven't tried them.
  • It has some additional information on how to specifiy the used C-Runtime
anhoppe
  • 4,287
  • 3
  • 46
  • 58