10

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

Skully
  • 347
  • 2
  • 4
  • 19
  • Have you tried adding the directory to the `.lib` file in your `Project Properties`? – Nard Oct 22 '14 at 19:36
  • Thanks your for your comment. Well, there are actually no .lib files. I thought when I install Boost with NuGet the whole build process will be automated. The Boost source files are in the folder packages\boost.1.56.0.0\lib\native\include\boost. I have uploaded everything on [GitHub](https://github.com/swank-rats/image-processing). there is another folder packages\boost.1.56.0.0\build\native which includes boost.targets, where the native\include folder (mentioned above) is marked as AdditionalIncludeDirectories for the ClCompile. – Skully Oct 22 '14 at 19:49

4 Answers4

6

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.

Sergey Shandar
  • 2,357
  • 18
  • 25
  • But ASIO is not part of this package, or have I overlooked it? – Skully Oct 30 '14 at 10:11
  • 1
    Is not Boost.ASIO header-only library? If yes then you can use Boost nupkg and may be few additional precompiled packages such as boost_system-vc120 and boost_regex-vc120. See http://stackoverflow.com/questions/5089245/boost-asio-as-header-only As far as I understand, there are no boost asio lib file. – Sergey Shandar Oct 30 '14 at 18:57
  • 1
    I didn't know that - sorry. You are absolutely right. I had a look in my Boost lib folder. Actually there are no ASIO lib files. – Skully Oct 31 '14 at 08:26
2

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.

Marco A.
  • 43,032
  • 26
  • 132
  • 246
  • Thanks - but then I have another problem since the ASIO library is missing. That was the reason why I used the Boost packet from NuGet mentioned above. :/ – Skully Oct 22 '14 at 20:01
  • That's another question and problem. Anyway you should find the missing dependencies yourself with google. – Marco A. Oct 22 '14 at 20:02
2

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

Vertexwahn
  • 7,709
  • 6
  • 64
  • 90
  • 1
    ^ this worked great for me, thanks. The second half of this video was helpful to me to then set up my Visual Studio environment: http://youtu.be/5AmwIwedTCM?t=3m24s – lightw8 Mar 08 '15 at 23:53
0

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.

Community
  • 1
  • 1
Skully
  • 347
  • 2
  • 4
  • 19