iperf linux版本移植到android (使用工具链方式不是使用Android.mk)
2015-04-14 15:55
483 查看
由于很多程序是用makefile编译linux应用程序的,如果移植到android就要重新写Android.mk,对于不熟悉这个的人来说,特别麻烦,所以这里介绍只修改makefile就能移植到android板子上面。还有试过这种方式,今天就试试。首先设置exportPATH=~/rowboat-android/wl18xx-snq/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin:$PATH设置arm-linux-androideabi交叉编译工具链网络上下载iperf并解压./configureCC=arm-linux-androideabi-gccCFLAGS=--sysroot=/home/snq/rowboat-android/wl18xx-snq/android-ndk-r9d/platforms/android-17/arch-arm/生成config.h和Makefile脚本然后makeall出现下面的编译结果g++-Wall-O2-oiperf--sysroot=/home/snq/rowboat-android/wl18xx-snq/android-ndk-r9d/platforms/android-17/arch-arm/-DHAVE_CONFIG_HClient.oExtractor.oLaunch.oList.oListener.oLocale.oPerfSocket.oReportCSV.oReportDefault.oReporter.oServer.oSettings.oSocketAddr.ognu_getopt.ognu_getopt_long.omain.oservice.osockets.ostdio.otcp_window_size.o../compat/libcompat.a/usr/bin/ld:Extractor.o:RelocationsingenericELF(EM:40)Extractor.o:couldnotreadsymbols:Fileinwrongformatcollect2:ldreturned1exitstatusgoogle结果显示http://stackoverflow.com/questions/8168950/cross-compiling-c-project-relocations-in-generic-elf-em-3http://stackoverflow.com/questions/329059/what-is-gxx-personality-v0-for在CFLAGS后面添加-fno-exceptions-lstdc++还有一个错误
http://blog.csdn.net/linux_lyb/article/details/3536911后来发现config.h.in里定义了#undefmalloc#undefrealloc把这两个去掉,编译顺利通过。
exportCXX=/home/matt/CodeSourcery/bin/arm-none-linux-gnueabi-g++大多都说是g++问题,修改每个makefile里面g++相关的CXX,不要在设置./configure的时候修改出显示不能checkingwhethertheC++compilerworks...noconfigure:error:in`/home/snq/rowboat-android/wl18xx-snq/iperf-2.0.5':configure:error:C++compilercannotcreateexecutablesSee`config.log'formoredetails.所有的地方都修改
arm-none-linux-gnueabi-g++替换g++不然会出现很多错误,基本都是这个引起的继续编译出现
undefinedreferenceto`__gxx_personality_v0'
两个错误google之后/article/2298167.htmlerror:undefinedreferenceto‘__cxa_end_cleanup’
undefinedreferencetorpl_malloc
http://blog.csdn.net/linux_lyb/article/details/3536911后来发现config.h.in里定义了#undefmalloc#undefrealloc把这两个去掉,编译顺利通过。
相关文章推荐
- 基于linux-2.6.38.8内核的SDIO/wifi驱动分析&&android 平台USB wifi驱动移植及使用 SDIOwifi
- Cocos2d-X移植时android.mk文件的处理方式
- linux环境使用Eclipse开发Android应用程序时使用真机调试方式
- 如何使用android独立工具链快速移植开源项目
- Linux内核使用三种不同的版本编号方式。
- 在Linux下使用NDK把libcurl移植到android平台的过程
- 移植Iperf到android 用来学习linux移植到安卓的例子
- Android 使用版本控制工具时添加忽略文件的方式(详解)
- Android 使用版本控制工具时添加忽略文件方式
- Android 使用版本控制工具时添加忽略文件方式
- Android BroadCast 各种注册和发送方式的特点整理以及7.0以上版本的使用变化
- linux使用yum方式下载指定版本的mysql
- linux网卡状态程序移植到android无法使用getifaddrs的问题
- 基于MT6752/32平台 Android L版本驱动移植步骤 根据MK官网所述,在Android L 版本上Turnkey ABS 架构将会phase out,而Medi
- Android 使用版本控制工具时添加忽略文件的方式(详解)
- Android 使用版本控制工具时添加忽略文件的方式(详解)
- Android 使用版本控制工具时添加忽略文件方式
- Android 使用版本控制工具时添加忽略文件方式
- Android中HttpURLConnection使用get方式向服务器提交json字符串
- iperf移植使用