Download a new arm-linux-gcc4.4.3 (: http://www.arm9.net/download.asp . Export Path = "/home/New/opt/friendlyarm/toolschain/4.4.3/bin: $ path" Export Path = "/home/New/usr/local/ARM/4.3.2/bin: $ path" The file format compiled by the General arm-GCC compiler is the same as that compiled by running make in the android source code tree through Android. mk.. Note 1: if the common arm-Linux-GCC compiler is linked to glibc, it can only be statically linked; otherwise, it cannot run on Android. Because the C library is different. Arm-ling-gcc -O a./Hello. C-static [1]. (Note: When running a program without static content, the dynamic library is required.{High total verification}) NOTE 2: arm-linux-gcc4.4.3 The version is not generic, but not the version of android2.3, or earlier than 4.3.2. Otherwise, the kernel Too old, segmentation fault error. Classic Note: static files compiled with arm-linux-gcc4.3.2 can run on Android. This will be used after the library is transplanted. You cannot directly use the compiler in the android source code package to compile the makefile project. How to Use the Cross Compiler [2]: The usage method is similar to that of the local GCC, but there is something special:RequiredThe-L and-I Parameters specify that the compiler uses the PostgreSQL system library and header file, instead of the local (x86) Library (the header file can sometimes be used locally ). Example:Iscsi-XXXX-Linux-GNU-GCC test. C-L/path/to/sparclib-I/path/to/sparcinclude ADB push hello Dev/Hello Pay attention to the following path/, and do not push it to another directory. Otherwise, the permission prompt will be executed. Denied. ADB shell chmod 777 DEV/Hello
ADB Shell CD Dev ./Hello output result! [1] See Http://blog.csdn.net/pottichu/article/details/5660982
[2] See
Http://www.360doc.com/content/10/0619/14/1795182_33985297.shtml
|
Original text in http://www.bangchui.org/read.php? Tid = 21889