缺少lboost_thread-mt在mongodb cpp驱动程序(ubuntu服务器x64) [英] missing lboost_thread-mt in mongodb cpp driver (ubuntu server x64)

查看:582
本文介绍了缺少lboost_thread-mt在mongodb cpp驱动程序(ubuntu服务器x64)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个全新的ubuntu服务器x64。



我安装了以下软件包





libboost-all-dev



mongodb-dev



mongodb-10gen



现在当我尝试编译示例代码时,我得到这个错误。



root @ server:/ home / user / Desktop#g ++ mongotest.cpp -pthread -lmongoclient -lboost_thread-mt -lboost_filesystem -lboost_program_options -lboost_system -o tutorial

/ usr / bin / ld:找不到-lboost_thread-mt



collect2:错误:ld退回1退出状态



i搜索无处不在,我可以想到,在每一种方式,我可以想到,但它不工作。



更新:
像vershov说它与lboost_thread但它需要lssl和lcrypto来编译



最后一个命令是:



g ++ mongoc。 cpp -pthread -lmongoclient -lboost_thread -lboost_filesystem -lboost_program_options -lboost_system -lssl -lcrypto -o tutorial



谢谢vershov !!

解决方案

http://packages.ubuntu.com/saucy/i386/libboost-thread1.54-dev/filelist 显示Ubuntu libboost-thread程序包具有 libboost_thread.so 库文件,而不是 libboost_thread-mt.so



因此,正确的命令是:



< server:/ home / user / Desktop#g ++ mongotest.cpp -pthread -lmongoclient -lboost_thread -lboost_filesystem -lboost_program_options -lboost_system -o tutorial


i have a brand new ubuntu server x64.

i installed the following packages

build-essential

libboost-all-dev

mongodb-dev

mongodb-10gen

now when i try to compile the example code i get this error.

root@server:/home/user/Desktop# g++ mongotest.cpp -pthread -lmongoclient -lboost_thread-mt -lboost_filesystem -lboost_program_options -lboost_system -o tutorial

/usr/bin/ld: cannot find -lboost_thread-mt

collect2: error: ld returned 1 exit status

i searched everywhere i can think of and in every way i can think of but it doesn't work.

UPDATE: like vershov said it works with the lboost_thread but it needs lssl and lcrypto to compile

the final command that worked for me is:

g++ mongoc.cpp -pthread -lmongoclient -lboost_thread -lboost_filesystem -lboost_program_options -lboost_system -lssl -lcrypto -o tutorial

thank you vershov!!

解决方案

Page http://packages.ubuntu.com/saucy/i386/libboost-thread1.54-dev/filelist shows that Ubuntu libboost-thread package has libboost_thread.so library file, not libboost_thread-mt.so

So, correct command is:

root@server:/home/user/Desktop# g++ mongotest.cpp -pthread -lmongoclient -lboost_thread -lboost_filesystem -lboost_program_options -lboost_system -o tutorial

这篇关于缺少lboost_thread-mt在mongodb cpp驱动程序(ubuntu服务器x64)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆