在Ubuntu中包括MongoDB C 驱动程序的错误
Error in including MongoDB C++ driver in Ubuntu
我一直在尝试将C 连接到MongoDB,但是它在许多层面上都会出现错误,现在我陷入了编译简单的代码。我遵循了本教程。我尝试使用下面的命令来编译教程中给出的代码。
g++ tutorial.cpp -Iinstall/include -Linstall/lib -pthread -lmongoclient -lboost_thread -lboost_filesystem -lboost_program_options -lboost_system -o tutorial
但它在控制台上打印了一个巨大的日志,并带有错误。最终部分输出在下面。
nce to `boost::re_detail::put_mem_block(void*)'
install/lib/libmongoclient.a(dbclient.o): In function `perl_matcher':
/usr/include/boost/regex/v4/perl_matcher.hpp:374: undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
install/lib/libmongoclient.a(dbclient.o): In function `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_match()':
/usr/include/boost/regex/v4/perl_matcher_non_recursive.hpp:973: undefined reference to `boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > > >::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > > > const&)'
collect2: error: ld returned 1 exit status
有人可以解释如何纠正此问题吗?
我通过在构建路径中添加" lboost_regex"来纠正此错误。我在此博客文章中纠正了官方教程中的所有错误。
相关文章:
- Mongdb C++ 驱动程序编译错误 for document{}.
- 如何找到 NVIDIA OpenGL 驱动程序的错误 ID 名称?
- 编译MongoDB C 11驱动程序的错误
- Apache IGNITE编译ODBC驱动程序错误
- Apache Ignite v2.7:无法构建 Linux ODBC 驱动程序 - 内联变量编译错误
- Microsoft访问 ODBC 驱动程序管理器函数序列错误
- QT 5.8 SQL连接错误:Windows 10上未加载QMYSQL驱动程序
- 错误 = 0x801F0020筛选器回复消息'error_flt_no_waiter_for_reply'微筛选器驱动程序
- 如何使用 C++ 驱动程序在 MongoDB 中使用 UserException 处理数据类型错误
- 从 UMDF 驱动程序调用创建文件时出现'Access is denied'错误 (C++)
- 在Ubuntu中包括MongoDB C 驱动程序的错误
- Cassandra cpp 驱动程序抛出错误,但能够与集群连接
- MongoDB C++ 驱动程序 -- 通过引用传递查询对象在随后使用其排序时会引发错误
- 错误 C2220:警告被视为驱动程序开发中生成的错误无'object'文件
- Mongo新的c++驱动程序错误
- GPU 驱动程序错误处理
- 使用 C++ 旧驱动程序的 mongodb 查询会导致 BSONElement:错误类型 -64
- Sybase DB 错误:数据库驱动程序错误.发送失败
- MongoDB C++ 驱动程序 - 错误:尚未声明"mongo::client"
- 简单的CUDA应用程序,cudaMalloc以错误结束:未指定的驱动程序错误