Linking Boost gives me error - c++

When trying to compile my solution with VS2010 I'm getting a compiler error:
"error LNK1104: cannot open file 'libboost_unit_test_framework-vc100-mt-gd-1_45.lib'"
I've tried to look for this file on hard drive but with no luck.
Why am I getting this error and how can I fix it?

you need to take precompiled Boost libraries for your system, e.g. from boostpro.com or build Boost yourself. Then add a path to Boost .lib's to your Linker paths

Some Boost libraries require building. As robin hood's answer notes, you can download an install with the binaries included, or you can build them yourself (which is slightly fiddly). See http://www.boost.org/doc/libs/1_45_0/more/getting_started/windows.html for an extensive discussion.

Related

Compiling LZ4 compression library on Windows

I'm trying to use the LZ4 compression library with a C++ project in Visual Studio 2013. I need to build the .dll files for it so I can link it in the project. I'm trying to use mingw to build it with the make file, but that is throwing unpleasant errors. Navigating to the base directory of the repository and running mingw32-make.exe gives the following error output:
process_begin: CreateProcess(NULL, uname, ...) failed.
The filename, directory name, or volume label syntax is incorrect.
Makefile:72: recipe for target 'lz4programs' failed
mingw32-make: *** [lz4programs] Error 1
I'm not overly familiar with compiling make files on Windows, and am having difficulty with figuring out what's causing the error. Additionally, in something that I find rather odd given how popular this compression library is, I cannot find any information online about compiling it for Windows. Any assistance in getting this thing to compile would be greatly appreciated.
I was able to use CMake with the CMakeLists.txt file in the cmake_unofficial folder to compile the library and the lz4 executable.
The solution is compiling a static version of the library. If you want a dll version, you should be able to experiment with the Visual Studio settings to get the dll if the static library isn't sufficient.

Missing boosts filesystem lib after build

I have the latest version of boost (1.58). After building it via command line on windows:
bootstrap
.\b2
I add boost dir to path and boost/stage/lib to lib path.
I add #include to my code and when I compile I get an error saying:
Error 1 error LNK1104: cannot open file 'libboost_filesystem-vc120-mt-sgd-1_58.lib' E:\SourceControl\zombiegame\ZombieGame\Projects\Windows\LINK ZombieGame
I'm not including any lib myself so guessing boost is doing this via the code, but this file doesn't exist in the stage/lib path.
The closest I have is libboost_filesystem-vc120-mt-gd-1_58.lib but you can see it's -gd- not -sgd- like it's asking for. What am I missing here?
You are probably using a configuration that is not provided by boost. Boost build its libraries with different settings for Debug/Release and (here I think is the point) for Runtime library (static lib/dynamic dll/single threaded/multithread). From the names I would guess you have a static or single threaded config. Try to change that one and you should find one of those provided by boost build.

naming convention not applied for boost libraries when built using VS2010

I just built Boost 1.54 using Visual Studio 2010. I am trying to link the built libs into my program and I am facing an issue there. The built libraries do not follow the Boost naming convention. For example, I have boost_atomic.lib instead of libboost_atomic-vc100-mt-1_54.lib
. When linking my program, VS errors out with the following error:
LINK : fatal error LNK1104: cannot open file
'libboost_atomic-vc100-mt-1_54.lib'
I checked my VS project and I do not refer to this anywhere. How do I fix this? Is there a flag that will generate Boost libs with the naming convention? If yes, I can rebuild boost. If not, how do I tell Boost to pickup the libs I have?
P.S: I did try adding boost_atomic.lib to additional libraries, but it keeps asking for that specific lib( I have defined BOOST_SP_USE_PTHREADS)

Can't find Boost 1.34.1 signals lib

I am trying to compile a CIGI's MPV for OpenSceneGraph using cmake. It's not very recent, it requires boost 1.34.1. So I downloaded it, cmake couldn't find the boost for a while. I put set(Boost_DEBUG 1) in the FindBoost.cmake and, amongst other things, got the following:
Searching for SIGNALS_LIBRARY_RELEASE: boost_signals-vc100-mt-1_34_1;boost_signals-vc100-mt;boost_signals-mt-1_34_1;boost_signals-mt;boost_signals
Searching for SIGNALS_LIBRARY_DEBUG: boost_signals-vc100-mt-gd-1_34_1;boost_signals-vc100-mt-gd;boost_signals-mt-gd-1_34_1;boost_signals-mt-gd;boost_signals-mt;boost_signals
Could not find the following Boost libraries:
boost_signals
Now I am trying to find this library. This instruction suggests I either build them myself or download them from a link, which is now broken. I couldn't built it with bjam (bjam --toolset=msvc stage) I kept getting error's like:
libs\program_options\src\cmdline.cpp(198) : error C2668: 'boost::bind' : ambiguous call to overloaded function
and
unknown compiler version please run the configure tests and report the results. Then I downloaded this installer which had only dll of needed library, release I assume and I need debug as well.
So a couple of questions presents itself:
1.Do I keep trying to compile boost, if so any tips?
2.Where do I get the libs I need?
3.I am assuming I need the .lib files not the .dll's, am i right?
I am really confused by now, please point me in the right direction.

Linking with boost .lib

I'm getting a link time error fatal error LNK1104: cannot open file 'libboost_serialization-vc80-mt-gd-1_44.lib' I recently downloaded boost which came with boost_serialization-vc80-mt-gd-1_44.lib but the compiler seems to be looking for one starting with libboost so i renamed it. but then it fails to find .dll at runtime. I tried to rename the dll but doesn't seem this helps.
While loading dll: An unhandled non-continuable STATUS_DLL_NOT_FOUND exception was thrown during process load
There are many different versions of each boost library: multi-threaded, single-threaded, static, dynamic, etc. The ones starting with "lib" are the static libraries, the ones without "lib" are the lib files used to link to the DLL versions. You can see this by looking at the lib file size.
If you are auto-linking boost, it means that the linker is looking for the static version of serialization. If you don't have such a file, it means you didn't build it. Another alternative is to use the installer available at http://www.boostpro.com. It allows you to select which boost libraries (static, dynamic, ST, MT, VS Version, etc) to download and install.
The other option is to disable auto-linking: see this post on the boost mailing list: http://lists.boost.org/boost-users/2005/12/15697.php