how to install boost to the VS 2008? - c++

I've almost completely installed Boost, but I have a problem with how to set my path to Boost in Tools->options->projects->VC++ Directories.
I've written the path to include files and libraries (my folder contains two subfolders, lib and include), but when I try to use Boost with
#include boost/regex.hpp, I got this linking error:
LINK : fatal error LNK1104: cannot open file 'libboost_regex-vc90-mt-gd-1_36.lib
Could you please tell me how to install Boost correctly for Visual Studio 2008?

Use the Boost Installer by the Boost consulting group.

You might be interested in the Visual Studio 2008 Feature pack. It adds many of the features that have only been available from Boost until now, the features that are part of the C++ TR1.

Also checkout this post for instructions on how to build Boost yourself.

Related

C++ boost nuget cannot open file Visual Studio 2015

I am making a C++ project (quite new to C++) and it needs the so called "boost" library. I thought I could add it with a nugget to make my life easier...(#include <boost\date_time.hpp> added) but now I am getting this error
Error LNK1104 cannot open file
'libboost_date_time-vc141-mt-gd-1_65_1.lib'
What is the problem?
Error LNK1104 cannot open file
'libboost_date_time-vc141-mt-gd-1_65_1.lib'
According to the error, you should add the libboost_date_time-vc141-mt-gd-1_65_1.lib library directory to your project configuration. This .lib included in the NuGet package boost_date_time-vc140 or boost_date_time-vc141.
Since you are using Visual Studio 2015, you just need install the NuGet package boost_date_time-vc140 to your project, NuGet will add the libboost_date_time-vc141-mt-gd-1_65_1.lib library directory to your project configuration automatically. After installation completed, that error will be resolved.
Besides, since you are use boost library in Visual Studio 2015, I suggest that you can use the boost-vc140, which included many dependencies. So you do not need to add them manually.
Hope this helps.
You need to add the boost library directory to your project configuration, go to the project menu, then properties.
In the property tree go down to 'VC++ Directories' and in the library directories add \lib64-msvc-12.0 (change the 64 to 32 for 32 bit builds).
I suggest you do this through view->other windows->property manager, then it will be set up for all future projects as well.
The reason why you have a link error is because you installed the header-only NuGet "Boost" package. However, due to an unfortunate design decision, this header-only package also contains header files for Boost libraries that are not header-only, such as datetime. With a better design, you would have gotten the error earlier (at compile time).
The "Boost.vc120" and "Boost.vc140" packages contains both header-only libraries and regular compiled libraries; the difference between them is the compiler used.

how to install boost/asio.hpp library for C++ visual studio 2015

Hello I am trying to install this library for use in one of my visual studio projects.
I know I have to go to \project properties-linker-general-additional library Directories but once I get there I don't know what to do.
I am stuck here :
Here's a step-by-step tutorial for installing, (optionally) building, and referencing boost in Windows: http://www.boost.org/doc/libs/1_61_0/more/getting_started/windows.html#get-boost
Obtain a copy of boost and put it to a folder boost_root (name as you please). If you haven't done it already, the easiest way is to get a precompiled zip from boost
Find the directory where your boost binaries are located. It usually is under the lib subdirectory, ie boost_root\libs.
Under the Additional library directory of visual studio (the one you mention in your post), enter the full or relative path to the boost dll directory, ie path_to_boost_root\boost_root\libs

VS2013 Boost using NuGet

I have been trying for days to get boost to work with my Visual Studio 2013 Premium install. I tried it with a zip install, and now with NuGet. Both methods have gotten me to same point of a linker error.
The error: 1>LINK : fatal error LNK1104: cannot open file 'libboost_system-vc120-mt-gd-1_57.lib'
I looked through the mailing list for boost and found someone posting of a similar issue, but that was from 2012 with boost_1_54_0 or something, so not relevant at all to VS2013 or boost 1_58_0.
I've also looked at a few forum posts, including SO, but none of them have the same issue I'm having. Either that, or they simply have no replies.
I can't really discern any of the flags that the error show because this is my first time ever using anything other than STL libraries or my own headers.
Any and all help would be appreciated, let me know if there's any other additional info that would be helpful.
I suspect you installed the NuGet package named simply "boost". This seems to contain all the Boost headers, but no compiled libraries. That's fine if you're interested in using only the header-only Boost libraries (i.e. most of them).
What you really want is the package named "boost-vc120" (vc120 refers to VC++ 12.0, which is the VC++ version that ships with VS2013). This has all the libraries as well. You'll notice that it'll take a lot longer to install.
In either case, NuGet will take care of setting up all the necessary VC++ Directories settings. No further configuration is needed.
The structure of Boost NuGet packages is here. You can use boost-vc120 but it will download ALL boost libraries to your project. So if you want to save disk space, then use boost package which gives you header files, and specific binary packages. In your case, it's boost_system-vc120.
You can't remove boost package because binary packages, such as boost-vc120/boost_system-vc120, depend on it.
Does the file libboost_system-vc120-mt-gd-1_57.lib exist on your hard drive?
If yes, did you add the .lib to the linker/input/Additional Dependencies?
Go to following web page:
https://github.com/sergey-shandar/getboost
From there you find "NuGet Packages for Boost." with multiple links.
If you pick first link - you will get to boost-includes nuget-package
instructions. Basically you need to open Package manager in Visual studio, select correct project, and type command "Install-Package boost -Version 1.69.0" - it will enable
boost includes automatic downloading to "packages" folder.
By following other links you can get boost static libraries for your specific Visual studio - follow "boost-vc141" to get Visual studio 2017 static libraries.
That boost package will get a lot of boost libraries - if you don't need all of them - make temporary project, get boost static libraries, and copy paste libraries which you need by yourself.

Visual Studio 2013 (vs120) asks for wrong boost libraries

I'm trying to compile one of my projects on Windows 7, using Visual Studio 2013. I've installed Boost 1.53 and setup the solution using cmake.
What happens is that now the compiled libraries of boost are in the form libboost_*-vc120-mt(-gd)-1_53.lib. In the linker project options, under the input tab, I have verified that the libraries that I need are there, and in fact the compiler is able to correctly read them.
However, for some reason that I absolutely can't understand, the linker is also trying to find libraries compiled as vc110. For example:
error LNK1104: cannot open file 'libboost_filesystem-vc110-mt-gd-1_53.lib'
The Platform Toolset that is listed in the project option is "Visual Studio 2013 (v120)". I couldn't find any reference to vc110 in any of the project options. Can you help me understand what is happening?
This post thankfully solves my question. I wasn't able to find it before. The solution is to edit the boost/config/auto_link.hpp because the code inside is not able to handle vc120, and ends up suggesting vc110
How do I specify, which version of boost library to link to?
The library name is autogenerated in the boost header version.hpp
Possibly the version wasn't rebuilt, or you are pointing at the wrong header version?
Instead of patching the config file try just defining a macro before the header inclusion .. this is what I did in my project
//#define BOOST_LIB_TOOLSET "vc100"
//#include

Visual Studio - find out why Visual Studio tries to link to class X? [duplicate]

This is what I have done:
Download the 1.54 zip file from the boost website
Extracted/copied it to C:\Program Files (x86)\Boost
Inside Visual Studio I have set the include libraries to: C:\Program Files (x86)\Boost\boost_1_54_0\boost_1_54_0\
(This seems to work fine for getting the compiler to accept the libraries)
Now the bit i'm having problems with- linker:
Inside Visual Studio I have set the linker include directories to: C:\Program Files (x86)\Boost\boost_1_54_0\boost_1_54_0\libs\
When I compile my project I get:
fatal error LNK1104: cannot open file 'libboost_date_time-iw-mt-sgd-1_54.lib'
EDIT Have built the boost binaries using the answer below. However I now have these files:
libboost_date_time-vc110-1_54.lib
libboost_date_time-vc110-gd-1_54.lib
libboost_date_time-vc110-mt-1_54.lib
libboost_date_time-vc110-mt-gd-1_54.lib
libboost_date_time-vc110-mt-s-1_54.lib
libboost_date_time-vc110-mt-sgd-1_54.lib
libboost_date_time-vc110-s-1_54.lib
libboost_date_time-vc110-sgd-1_54.lib
but still no
'libboost_date_time-iw-mt-sgd-1_54.lib'
EDIT: Think I have found the problem:
http://lists.boost.org/Archives/boost/2004/08/70114.php
OK, here's the problem: originally we had one Intel toolset:
"intel-win32" which created the library suffix "iw" (note no version
number!), and this is what the auto-link header currently searches
for.
However people have started adding versioned Intel toolsets, which
means that we now produce an ad-hoc mixture of library names, some
with compiler-version suffixes and some without, the autolink code
could handle either form, but as it's not psychic it can't handle
both :-(
Solution is to #define BOOST_ALL_NO_LIB
On a 64bit system you should build boost in Program Files, not Program Files(x86) the boost automatic library include does not handle the redirection correctly. Alternatively you can manually manage the library inclusion... but I would highly recommend against it.
Also a reminder that you need to build boost in all the flavors and bitnesses you are going to use. See How to use Boost in Visual Studio 2010 for a good example of how to do so.
In an administrator visual studio command prompt go to the boost directory
run bootstrap.bat
run b2 --toolset=msvc-10.0 --build-type=complete architecture=x86 address-model=64
wait for b2 to finish building
EDIT:
As it turns out the iw in that library refers to the intel compiler... to use that with boost and visual studio you'll need to follow the directions from Intel.