在Linux Ubuntu Server上提升11.10(VPS)使用ASIO编译C
boost on linux ubuntu server 11.10 (vps) compiling with C++ using asio
我遵循了UNIX的指南。http://www.boost.org/doc/libs/1_51_0/more/getting_started/unix-variants.html。它在我的Mac上正常工作。但是在我的VPS上,我似乎遇到了一些问题。我下载了最新的构建,并运行了bootstrap和b2 install和示例。cpp工作正常。
当我疲倦地编译UDP ECHO服务器时-http://www.boost.org/doc/libs/1_38_0/doc/doc/html/boost_asio/echo/echo/echo/echo/ashync_udp_echo_server.cpp
我有以下错误。
andrew@am:~/Documents/boostExamples/asyncUdpEchoServer$ c++ -I /usr/local/boost main.cpp -o udpEchoServer
/tmp/cczYAR1r.o: In function `__static_initialization_and_destruction_0(int, int)':
main.cpp:(.text+0x21e): undefined reference to `boost::system::generic_category()'
main.cpp:(.text+0x228): undefined reference to `boost::system::generic_category()'
main.cpp:(.text+0x232): undefined reference to `boost::system::system_category()'
/tmp/cczYAR1r.o: In function `boost::system::error_code::error_code()':
main.cpp:(.text._ZN5boost6system10error_codeC2Ev[_ZN5boost6system10error_codeC5Ev]+0x10): undefined reference to `boost::system::system_category()'
/tmp/cczYAR1r.o: In function `boost::asio::error::get_system_category()':
main.cpp:(.text._ZN5boost4asio5error19get_system_categoryEv[boost::asio::error::get_system_category()]+0x7): undefined reference to `boost::system::system_category()'
collect2: ld returned 1 exit status
有什么想法我需要在这里做什么? - 如果您不需要建立增压的影响,我很方便。
VPS正在运行Ubuntu Server 11.10,但似乎有点降低。我已经安装了建筑物。
您必须链接boostrongystem lib: -lboost_system
。也不要忘记在需要时指定lib目录。
相关文章:
- 如何创建一个CMake变量,除非显式重写,否则使用默认值
- C++:TypeDef使用元组
- 使用std::multimap迭代器创建std::list
- 从不同线程使用int64的不同字节安全吗
- 比较并显示使用最小值(a,b)和最大值(a、b)升序排列的4个数字
- 为什么在全局范围内使用"extern int a"似乎不行?
- 在C#中处理C++指针而不使用unsafe的最佳方法
- 使用C++库在Android项目中修改gradle中的cmake参数,用于插入指令的测试
- 如何使用Google Mock来模拟gettimeofday()
- 如何使用默认参数等选择模板专业化
- 为什么使用 "this" 指针调用派生成员函数?
- 使用新行和不使用新行读取文件
- 如何使用 < 和 > 命令获取 c++ 中的输入和输出?
- 如何确定我已使用非编码文件到达 EOF?
- 如何在cuSparse中使用cusparseXcoo2csr从coo转换为csc
- 使用CMake创建QML插件
- 使用strcpy将char数组的元素复制到另一个数组
- 在c++中使用nlohmann从类到json的转换
- 使用指针从C++中的数组中获取最大值
- 在Linux Ubuntu Server上提升11.10(VPS)使用ASIO编译C