Boost C++ Libraries linker error libboost_serializ

2019-08-06 17:16发布

问题:

I'm using Boost C++ Libraries v1.47 to serialize an class (I used the installer and selected everything and for VS2010). But I get a error from my Visual Studio 2010 linker "Lnk1104 Can not open libboost_serialization-vc100-mt-gd-1_47.lib". I set up the "c:\program files\boost\boost_1_47" for my includes and "c:\program files\boost\boost_1_47\lib" for my libs. I don't know what's going wrong.

Update

I don't know why but if I put the lib files from the boost directory to "c:\program files\Microsoft Visual Studio 10.0\VC\lib" everything work fine. Boost load the lib files somehow dynamical.

回答1:

If you cannot find the file on your computer with the windows searcher just ask anybody else who uses boost to give you a copy of that file (libboost_serialization-vc100-mt-gd-1_47.lib). My friend from work used to have the same trouble after having installed boost, there was just not the file in the boost folder. At the same time I picked up the file successfully so we copied it to the right directory on his computer.



回答2:

For some reason precompiled libs in the installer are named on format "boost-module-vc100..." and headers specify library name as "libboost_module-vc100...". So you should specify library name in project settings to make it linked correctly.

I solved this issue by compiling all boost libraries by myself. With modern PC it won't take too long to do.



回答3:

to resolve this problem, go to properties -> Linker -> General -> Additional Library Directories Enter the path of boost: Boost-path\stage\lib



标签: c++ boost