编译mongodbc++;驱动程序,增压错误(Windows) 我试图在Windows上编译MangGDB C++驱动程序。我正在使用SCons“Make”工具。它给了我一个Boost错误,我有引导库,但我不确定如何让它链接到SCons构建文件。我习惯于在VS中添加引用。看起来我需要一个环境变量引用,但我不确定

编译mongodbc++;驱动程序,增压错误(Windows) 我试图在Windows上编译MangGDB C++驱动程序。我正在使用SCons“Make”工具。它给了我一个Boost错误,我有引导库,但我不确定如何让它链接到SCons构建文件。我习惯于在VS中添加引用。看起来我需要一个环境变量引用,但我不确定,mongodb,boost,Mongodb,Boost,以下是错误: 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++ lib

以下是错误:

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()

因此,我最终能够通过发现以下内容来提升LIB:

scons --extrapath=c:\boost

C:\boost是boost的目录。我现在遇到编译器错误,但这比以前更严重

您可以使用--cpppath选项添加其他包含路径

--cpppath : Include path if you have headers in a nonstandard directory
此外,请记住编译引导库并链接到包含boost library.lib文件的正确文件夹

--libpath : Library path if you have libraries in a nonstandard directory
因此,您应该发出类似以下命令:

scons --cpppath=c:\boost --libpath=c:\boost\stage\lib

既然您在C++安装上遇到了麻烦,我能假设您没有C驱动程序构建的问题吗?因为那就是我现在被困的地方。在MunGDB DOORG<代码> C++ MunGDB驱动程序页面上,它下载C++驱动程序,然后转到这个链接来安装它:页面告诉你做的第一件事就是安装C驱动程序(如果需要的话,它也可以构建LiBbSon)。然后,指令编译C++驱动程序。我看错了吗?这两个安装都是一个页面吗&我只需要做后一个?