我正在尝试在 Windows 上编译 MongoDB C++ 驱动程序。我正在使用 SCons“制作”工具。它给了我一个 Boost 错误,我有引导库,但我不确定如何让它与 SCons 构建文件链接。我习惯于在 VS 中添加引用。看起来我需要一个环境变量引用,但我不确定。
这是错误:
scons mongoclient
scons: Reading SConscript files ...
Checking for C++ library boost_thread-mt... (cached) no
Checking for C++ library boost_thread... (cached) no
Checking for C++ library boost_filesystem-mt... (cached) no
Checking for C++ library boost_filesystem... (cached) no
Checking for C++ library boost_system-mt... (cached) no
Checking for C++ library boost_system... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
cl /Fobuild\mongo\bson\oid.obj /c src\mongo\bson\oid.cpp /TP /nologo /EHsc /O2 /
D_SCONS /DMONGO_EXPOSE_MACROS /Ibuild /Isrc /Ibuild\mongo /Isrc\mongo
oid.cpp
src\mongo/pch.h(48) : fatal error C1083: Cannot open include file: 'boost/shared
_ptr.hpp': No such file or directory
scons: *** [build\mongo\bson\oid.obj] Error 2
scons: building terminated because of errors.
在 SConstruct 文件中,我找到以下内容,但不确定查找 boost 库的确切含义。
boostLibs = ["thread", "filesystem", "system"]
conf = Configure(env)
for lib in boostLibs:
if not conf.CheckLib(["boost_%s-mt" % lib, "boost_%s" % lib],
language="C++"):
if not win:
Exit(1)
conf.Finish()