views:

84

answers:

1

I'm new to boost lib and trying to compile a simple example about how the serialization works with boost library from http://www.boost.org/doc/libs/1_42_0/libs/serialization/example/demo.cpp

on compiling i get the linker error:

1>LINK : fatal error LNK1104: cannot open file 'libboost_serialization-vc80-mt-sgd-1_42.lib'

I also tried to copy and put the .lib file in project directory but the VS 8.0 complier can't still link to it.

A: 

To post-answer the question fully..

The error is from the auto-linking Boost implements and it's telling you that it picked to auto-link a version of the serialization lib that you don't have compiled. You could try compiling the different version by following the instructions in building from source (see building from source). Specifically the "mt-sgd" tag on the library name tells you that it's looking for the multi-threaded static debug C++ runtime with the debug version of the library (see library naming). Switching to "/MDd", as you did, makes the compiler switch to the multi-threaded dynamic debug C++ runtime (see MSVC run-time flags) which happens to be the default build for Boost. And hence it then finds it, as you already have it built.

GrafikRobot