sla89
sla89

Reputation: 347

vc++ vs2013 code with boost powered by nuget does not build

I am quite new to VC++ and Boost. My problem is that I want to use Boost 1.56.0 in my VC++ Visual Studio 2013 project (so I use vc120).

I have installed Boost via NuGet (https://www.nuget.org/packages/boost/). Everything seems to be okay, but when I try to build my project it says:

Fatal error LNK1104: Cannot open file "libboost_thread-vc120-mt-gd-1_56.lib".

Do you know where exactly the problem is and how I can fix it?

I thought installing a package using NuGet will do the whole job to get things working on its own. I know that the linker can't find the lib file (actually there was no build process at all). But I don't know how I can fix this issue.

I think it is not a good idea to manually compile Boost with VC120 and add the lib folder to the additional paths of the linker. Why should I use NuGet then?

Any help is welcome - I am trying and searching the internet for so many hours now and I couldn't fix the problem.

Thank you, Stefan

Upvotes: 10

Views: 3860

Answers (4)

Sergey Shandar
Sergey Shandar

Reputation: 2387

As mentioned before, Boost Nuget can't contain all possible compiled libraries for all possible configuration and compiler versions. However, there are separete precompiled Nuget packages and also source packages. Here is a list of all 1.56.0 Boost Nuget packages https://getboost.codeplex.com/releases/view/126256

In your case, I would suggest to use precompiled boost_thread-vc120.1.56.0. Not 1.57 yet!

If you are lazy, you can also use boost-vc120.1.56.0 which depends on all precompiled Boost libraries for Visual Studio 2013.

Upvotes: 6

Vertexwahn
Vertexwahn

Reputation: 8152

BlueGo is a tool which builds Boost using Visual Studio 2010/12/13. You just have to start the application, select your configuration and hit the Build button- everything else works automatically.

BlueGo

It can be downloaded here: https://bitbucket.org/Vertexwahn/bluego

Upvotes: 2

sla89
sla89

Reputation: 347

Since the NuGet packet of Boost does not contain the lib files anymore, because the package is getting to big, I have decided to build Boost by my own.

I followed this instructions: Build Boost for Visual Studio - also read the second post!

I saw it too late but maybe it is helpful for somebody else: There are pre-build Boost installer! Here you can download an installer, which will install Boost (of specific version) for 32/64 bit (depending on which file you choose). There are also already different versions (vc100, vc110, vc120) available.

The problem when you use NuGet is, that you have

  1. Install the Boost package (to get the source files)
  2. Install the lib files (see the link Marco A. provided)

This can be very cumbersome since not all libraries of Boost are available. E.g. the lib files of ASIO were missing. So if you need them you have to compile it again by your own. So you mess up your project with NuGet packages and self-compiled boost libs. If NuGet provides everything you need I would use the NuGet way.

Finally, as I said I need the ASIO lib and therefore I have finally compiled Boost by my own. It seemed so easy to just use a NuGet Package.

Thank you all for your help.

Upvotes: 0

Marco A.
Marco A.

Reputation: 43662

It seems that the latest version of NuGet for boost doesn't include every lib and dll files package (source).

You should install boost_thread altogether.

Upvotes: 2

Related Questions