在ubuntu服务器上构建Mongodb时出错



我正试图在ubuntu服务器(13.10)上使用--ssl选项构建mongodb(r2.4.8)

我得到这些错误:

scons --ssl --64 all
src/third_party/boost/boost/date_time/posix_time/posix_time_io.hpp: In function 'std::basic_ostream<_CharT, _Traits>& boost::posix_time::operator<<(std::basic_ostream<_CharT, _Traits>&, const boost::posix_time::time_duration&)':
src/third_party/boost/boost/date_time/posix_time/posix_time_io.hpp:183:51: error: typedef 'std_ptime_facet' locally defined but not used [-Werror=unused-local-typedefs]
     typedef std::time_put<CharT>                  std_ptime_facet;
                                                   ^
In file included from src/third_party/boost/boost/config.hpp:57:0,
                 from src/third_party/boost/boost/smart_ptr/shared_ptr.hpp:17,
                 from src/third_party/boost/boost/shared_ptr.hpp:17,
                 from src/mongo/pch.h:48,
                 from src/mongo/shell/dbshell.cpp:18:
src/mongo/db/../bson/bsonobjbuilder.h: In member function 'void mongo::BSONArrayBuilder::fill(int)':
src/third_party/boost/boost/static_assert.hpp:125:21: error: typedef 'boost_static_assert_typedef_836' locally defined but not used [-Werror=unused-local-typedefs]
          BOOST_JOIN(boost_static_assert_typedef_, __LINE__)
                     ^
src/mongo/db/../bson/bsonobjbuilder.h:836:13: note: in expansion of macro 'BOOST_STATIC_ASSERT'
             BOOST_STATIC_ASSERT(maxElems < (BSONObjMaxUserSize/10));
             ^
In file included from src/third_party/boost/boost/filesystem/v3/path_traits.hpp:23:0,
                 from src/third_party/boost/boost/filesystem/v3/path.hpp:25,
                 from src/third_party/boost/boost/filesystem/v3/operations.hpp:25,
                 from src/third_party/boost/boost/filesystem/operations.hpp:31,
                 from src/mongo/shell/dbshell.cpp:20:
src/third_party/boost/boost/system/error_code.hpp: At global scope:
src/third_party/boost/boost/system/error_code.hpp:214:36: error: 'boost::system::posix_category' defined but not used [-Werror=unused-variable]
     static const error_category &  posix_category = generic_category();
                                    ^
src/third_party/boost/boost/system/error_code.hpp:215:36: error: 'boost::system::errno_ecat' defined but not used [-Werror=unused-variable]
     static const error_category &  errno_ecat     = generic_category();
                                    ^
src/third_party/boost/boost/system/error_code.hpp:216:36: error: 'boost::system::native_ecat' defined but not used [-Werror=unused-variable]
     static const error_category &  native_ecat    = system_category();
                                    ^
cc1plus: all warnings being treated as errors
scons: *** [build/linux2/64/ssl/mongo/shell/dbshell.o] Error 1
scons: building terminated because of errors.

这些只是错误列表中的几个错误。。。

我做错了什么?

感谢

当使用GCC4.8编译时,这实际上看起来像是boost中的一个错误。我最近升级到13.10(桌面),开始出现完全相同的问题。果不其然。。。

acron@####:~$ g++ --version
g++ (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1

谷歌搜索了一下,发现了这个:

https://svn.boost.org/trac/boost/ticket/7242

简单的修复方法是使用-Wno-unused-local-typedefs进行编译,您可以将其添加到scons文件中。

最简单的方法:

sudo apt-get build-dep mongodb # or monodb-server

实际上,您只需一句话就可以从源代码轻松地编译debian包:

apt-get source --compile mongodb

这告诉您Debian开发人员已经计算出了哪些是必需的依赖项。90%的时间,这使我能够快速定位丢失的位

相关内容

  • 没有找到相关文章

最新更新