• (OK—C++程序) CodeBlocks — CentOS 7 + android-ndk


    CodeBlocks全局编译参数(Settings->Compiler具体设置,
    参考 http://blog.chinaunix.net/uid-14735472-id-5194999.html

    打开CodeBlocks,选择菜单Settings->Compiler 在弹出的窗口中选取GNU ARM GCC Compiler,当然也可以Copy一个新的,重命名为GNU ARM GCC Compiler For Android,再进行如下设置:


    上图中,都不选。






    上图和下图是一个内容











    -------------- Build: Debug in helloworld (compiler: GNU ARM GCC Compiler For Android)---------------
    //编译命令
    arm-linux-androideabi-g++ -Wall -O0 -g3 -fPIC -c -fmessage-length=0 -fno-exceptions -MMD -MP -DANDROID -I/opt/android-on-linux/android-ndk-r10d/sources/cxx-stl/stlport/stlport -I/opt/android-on-linux/android-ndk-r10d/platforms/android-21/arch-arm/usr/include -I/opt/android-on-linux/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/include -I/opt/android-on-linux/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/include-fixed -I/opt/android-on-linux/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/include -c main.cpp -o obj/Debug/main.o

    //链接命令
    arm-linux-androideabi-g++ -L/opt/android-on-linux/android-ndk-r10d/sources/cxx-stl/stlport/libs/armeabi-v7a -L/opt/android-on-linux/android-ndk-r10d/platforms/android-21/arch-arm/usr/lib/ -o bin/Debug/helloworld obj/Debug/main.o  -nostdlib -Xlinker -R/opt/android-on-linux/android-ndk-r10d/platforms/android-21/arch-arm/usr/lib /opt/android-on-linux/android-ndk-r10d/platforms/android-21/arch-arm/usr/lib/crtbegin_dynamic.o /opt/android-on-linux/android-ndk-r10d/platforms/android-21/arch-arm/usr/lib/crtend_android.o  -lstdc++ -lstlport -lc

    //结果
    Output file is bin/Debug/helloworld with size 100.25 KB
    Process terminated with status 0 (0 minute(s), 0 second(s))
    0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
     

    //测试

    [root@localhost Debug]# pwd
    /opt/codeblosks-workspace/helloworld/bin/Debug
    [root@localhost Debug]# ls
    helloworld

    [root@localhost Debug]# file helloworld
    helloworld: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
    [root@localhost Debug]# adb root
    [root@localhost Debug]# adb push helloworld /data/data/
    3221 KB/s (101856 bytes in 0.030s)
    [root@localhost Debug]# adb shell

    root@mb526:/data/data # ./helloworld
    Hello world!
  • 相关阅读:
    stylish——一键为网页换肤,改变字体大小,去除广告
    css3实现可以计算的自适应布局——calc()
    用一个div模拟textarea并实现高度自适应
    关于background定位
    CSS3 :nth-of-type() 选择器
    css3圣诞雪景球
    ie6、7、8兼容部分css3
    html5 录制mp3音频,支持采样率和比特率设置
    html5 图片上传,支持图片预览、压缩、及进度显示,兼容IE6+及标准浏览器
    grunt配置太复杂?使用Qbuild进行文件合并、压缩、格式化等处理
  • 原文地址:https://www.cnblogs.com/ztguang/p/12647113.html
Copyright © 2020-2023  润新知