编译Boost阻塞TCP Echo客户端的问题 [英] Problem in Compiling Boost Blocking TCP Echo Client

查看:93
本文介绍了编译Boost阻塞TCP Echo客户端的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编译 Boost的示例阻止TCP ECHO客户端 [ ^ ]使用g ++编译器:



g ++ -o test Simulator_main.cpp -I / home / ha / MIH / boost_1_49_0 / -L / usr / local / lib / -lboost_system -lpthread



编译成功,但是当我运行程序时得到以下错误



root @ ubuntu:/ home / ha / MIH / ODTONE / app / lte_sim#。/ test

./ test:加载共享库时出错:libboost_system.so.1.49.0:无法打开共享对象文件:没有这样的文件或目录



所以任何建议如何解决问题?



另外如何使用Boost.build b2命令进行编译?



提前多多谢谢。

I am trying to compile The example of Boost Blocking TCP ECHO Client[^] using g++ compiler:

g++ -o test Simulator_main.cpp -I /home/ha/MIH/boost_1_49_0/ -L /usr/local/lib/ -lboost_system -lpthread

The compilation is success, but when I run the program I get the following errors

root@ubuntu:/home/ha/MIH/ODTONE/app/lte_sim# ./test
./test: error while loading shared libraries: libboost_system.so.1.49.0: cannot open shared object file: No such file or directory

So any suggestion how to solve the problem?

Also how can I use the the Boost.build b2 command to do the compilation?

Thanks a lot in advance.

推荐答案

在Windows上你可以把libboost_system.so.1.49.0放在同一个'文件夹'中编译的(exe)(不是一个很好的想法,像大的发行版像升级),或者,确保所有的升级'二进制'/编译的库/ dll的目录在你的路径上



我不确定Linux如何搜索libs / dll,我会将lib目录添加到你的工作路径并试试



假设:你已编译或正在使用二进制发行版进行提升,是吗? - iirc,boost有一个部署选项,你可以在其中说明将编译过的libs / dll部署到哪里,所以我会看一下,然后使用那个路径





'g'
On windows you would either put libboost_system.so.1.49.0 in the same 'folder' as the compiled (exe) (not a good idea with big distro's like boost), or, make sure the directory where all the boost 'binary'/compiled libs/dlls is/are is on your path

Im not sure how Linux searches for libs/dll's, I'd go with adding the lib directory to your working path and trying that

assumption : you have compiled or are using a binary distro for boost, yes ? - iirc, boost has a deploy option, where you state where to deploy compiled libs/dlls to, so I'd look at that, and use that path


'g'


这篇关于编译Boost阻塞TCP Echo客户端的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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