简体   繁体   中英

linker error from boost/serialization/vector #include

I need to use Boost to serialize an std::vector, but when I add the line

#include <boost/serialization/vector.hpp>

to my project, I get an LNK1104 error: cannot open file 'libboost_serialization-vc141-mt-gd-x64-1_66.lib'. I had, however, already added

#include <boost/serialization/array.hpp>

without any errors cropping up. Since those two files are in the same folder, I wouldn't think the problem could be that I've overlooked a place where I need to tell Visual Studio where to look for the file. I've tried restarting my computer and closing all code windows in Visual Studio before compiling, so I'm pretty sure it can't be that I have the file open somewhere without realizing it either. What else could it be?

Missing headers is not the problem. You would have a Cannot include boost/serialization/vector.hpp

You need to add the directory containing libboost_serialization-vc141-mt-gd-x64-1_66.lib into the Library Directories of your project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM