Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 456
user3857017 Avatar asked Apr 29 '15 19:04

user3857017


People also ask

Can I use NuGet with C++?

You can use NuGet in any C++ project type – this works for desktop, Windows Store, and Windows Phone 8 applications equally. The NuGet Gallery on nuget.org is the central package repository used by all package authors and consumers.

How use NuGet package in VB net?

NuGet Package ManagerSelect Project > Manage NuGet Packages. In the NuGet Package Manager page, choose nuget.org as the Package source. From the Browse tab, search for Newtonsoft.Json, select Newtonsoft.Json in the list, and then select Install. If you're prompted to verify the installation, select OK.

How use NuGet package in asp net?

Right-click the folder in the project, and then select Add Packages… Select the NuGet.org from the Package source drop-down. The Syncfusion ASP.NET Web Forms NuGet Packages are listed and available. Search and install the required packages in your application, by clicking Add Package button.

What is the benefit of NuGet package?

NuGet provides the tools developers need for creating, publishing, and consuming packages. Most importantly, NuGet maintains a reference list of packages used in a project and the ability to restore and update those packages from that list.


2 Answers

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.

like image 195
Ferruccio Avatar answered Oct 01 '22 11:10

Ferruccio


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.

like image 21
Sergey Shandar Avatar answered Oct 01 '22 11:10

Sergey Shandar