如何编译和运行C Android系统/ C ++程序 [英] How to compile and run a C/C++ program on the Android system

查看:87
本文介绍了如何编译和运行C Android系统/ C ++程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Q1)我想是我的机器上使用的Windows XP 操作系统上运行的Andr​​oid emulator.I一个简单的C程序。我已经安装了 SDK,JDK,日食为Android开发,并成功的AVD运行Android应用程序。

Q1) I want to run a simple c program on android emulator.I am using windows xp os on my machine. I have installed sdk, jdk, eclipse for android development and succeeded running android application on AVD.

Q2)我只需要知道有没有什么办法来运行 AVD C程序(没有任何Java)。在我的机器我已经安装了手臂,用我所编译的C程序。

Q2) I just need to know is there any way to run a C program(without any java) on AVD. On my machine I have installed arm and using that I have compiled a C program.

第三季)我也想知道是否有可能已编译的二进制推入Android设备或 AVD ,并使用Android设备或终端运行 AVD

Q3) I also want to know is it possible to push the compiled binary into android device or AVD and run using the terminal of the android device or AVD?

推荐答案

您可以用ARM交叉编译器编译C程序:

You can compile your C programs with an ARM cross compiler:

arm-linux-gnueabi-gcc -static -march=armv7 test.c -o test

然后你可以把你的编译好的二进制文件的地方(不要将其推入到SD卡):

Then you can push your compiled binary file to somewhere (don't push it in to the sdcard):

adb push test /data/local/tmp/test

这篇关于如何编译和运行C Android系统/ C ++程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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