boost 1.51.0移植到ARM S3C6410成功运行
来源:互联网 发布:混沌优化算法优缺点 编辑:程序博客网 时间:2024/06/14 09:54
http://blog.chinaunix.net/uid-8048969-id-3374823.html
OS :Fedora 13
Boost Ver: 1.51.0
Compiler : GNU gcc 4.3.2 for ARM
[root@localhost Release]# arm-linux-gcc -v
Using built-in specs.
Target: arm-none-linux-gnueabi
Configured with: /scratch/julian/lite-respin/linux/src/gcc-4.3/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --enable-shared --enable-symvers=gnu --enable-__cxa_atexit --with-pkgversion='Sourcery G++ Lite 2008q3-72' --with-bugurl=https://support.codesourcery.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc --with-build-sysroot=/scratch/julian/lite-respin/linux/install/arm-none-linux-gnueabi/libc --with-gmp=/scratch/julian/lite-respin/linux/obj/host-libs-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-mpfr=/scratch/julian/lite-respin/linux/obj/host-libs-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --disable-libgomp --enable-poison-system-directories --with-build-time-tools=/scratch/julian/lite-respin/linux/install/arm-none-linux-gnueabi/bin --with-build-time-tools=/scratch/julian/lite-respin/linux/install/arm-none-linux-gnueabi/bin
Thread model: posix
gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72)
[root@localhost Release]
2. 解压boost压缩包
3. 进入目录执行./bootstrap.sh, 此时形成bjam文件和project-config.jam
4. 编辑project-config.jam, 仅修改using gcc这行。因为我使用的是arm-linux-gcc,所以将其改以下即可:
using gcc : : arm-linux-gcc ;
5. 执行./bjam stage, ok大功告成.
6. 形成的静态和动态库文件就在stage目录下.
在得到boost 库后,把所需要的库放在ARM linux文件系统
我把其中的chrono system thread库放进去,并将其中boost的一个例程交叉编译运行blocking_tcp_echo_server.cpp
点击(此处)折叠或打开
- //
- // blocking_tcp_echo_server.cpp
- // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //
- // Copyright(c) 2003-2011 Christopher M. Kohlhoff(chris at kohlhoff dot com)
- //
- // Distributed under the Boost Software License, Version 1.0.(See accompanying
- // file LICENSE_1_0.txtor copy at http://www.boost.org/LICENSE_1_0.txt)
- //
- #include <cstdlib>
- #include <iostream>
- #include <boost/bind.hpp>
- #include <boost/smart_ptr.hpp>
- #include <boost/asio.hpp>
- #include <boost/thread.hpp>
- using boost::asio::ip::tcp;
- const int max_length= 1024;
- typedef boost::shared_ptr<tcp::socket> socket_ptr;
- void session(socket_ptr sock)
- {
- try
- {
- for (;;)
- {
- char data[max_length];
- boost::system::error_codeerror;
- size_t length = sock->read_some(boost::asio::buffer(data),error);
- if (error== boost::asio::error::eof)
- break; // Connection closed cleanly by peer.
- else if(error)
- throw boost::system::system_error(error);// Some othererror.
- boost::asio::write(*sock, boost::asio::buffer(data, length));
- }
- }
- catch (std::exception& e)
- {
- std::cerr<< "Exception in thread: " << e.what()<< "\n";
- }
- }
- void server(boost::asio::io_service& io_service, short port)
- {
- tcp::acceptor a(io_service, tcp::endpoint(tcp::v4(), port));
- for (;;)
- {
- socket_ptr sock(new tcp::socket(io_service));
- a.accept(*sock);
- boost::thread t(boost::bind(session, sock));
- }
- }
- int main(int argc, char* argv[])
- {
- boost::asio::io_service io_service;
- using namespace std; // For atoi.
- server(io_service, atoi(argv[1]));
- return 0;
- }
注意一点是需要将arm交叉编译的库的路径给正确加上
执行后结果发现库没找到
./boost_server
./boost_server: error while loading shared libraries: libboost_chrono.so.1.51.0: cannot open shared object file: No such file or directory
于是下载到arm平台再次执行测试
在arm linux中添加的库有下图
执行命令,端口号为2222
./boost_server 2222
开启四个客户端程序
- boost 1.51.0移植到ARM S3C6410成功运行
- boost 1.51.0移植到ARM S3C6410成功运行
- SQLITE+PYTHON成功移植到ARM开发板运行
- SSH 成功移植到 ARM 平台
- 移植SDL运行库到ARM11(s3c6410)上
- qwt移植到s3c6410
- oRTP移植到S3C6410
- Android2.0 Eclair在S3C6410上运行成功
- Android2.0 Eclair在S3C6410上运行成功
- Android2.0 Eclair在S3C6410上运行成功
- 移植Gens for linux到arm--------编译成功
- 成功的把ftk移植到arm-linux上
- 将Open SSH Server 移植到ARM Linux成功
- 成功移植NET-SNMP到ARM平台(转)
- 将Open SSH Server 移植到ARM Linux成功
- 将Open SSH Server 移植到ARM Linux成功
- 将Open SSH Server 移植到ARM Linux成功
- 成功将qt程序移植到arm板上
- 如何提高英语阅读能力 我是怎么阅读英语的?
- RIO包 健壮的I/O函数代码
- inline
- 检查java class的版本号
- 酷勤网程序员英语地址
- boost 1.51.0移植到ARM S3C6410成功运行
- Eclipse 开发利器 Jrebel热部署配置
- 十本格调女人读的书籍:
- 内核模块的Makeflie编写
- PHP中$_SERVER的详细参数与说明
- 快速构建MMO服务器框架(六)asio稍微复杂一些的例子:高并发echo
- Android程序的目录结构
- 提高vmware虚拟机运行速度
- POJ 1753 Flip Game