Firefly Open Source Community

Title: How can I cross-compile C program using toolchain in Android SDK? [Print This Page]

Author: fireworks    Time: 3/8/2017 16:20
Title: How can I cross-compile C program using toolchain in Android SDK?
Last edited by fireworks In 3/8/2017 16:33 Editor

I'd like to compile C program with arm-linux-androideabi-gcc in Android 5.1 SDK, but I couldn't because of following error.¡ư
         

So I tried several ways and now I'm using like this.

[Linux]
    1.  Created ¡®test¡¯ folder in ~/firefly-rk3288/build/external.
    2.  Wrote hello.c file in ~/firefly-rk3288/external/test.

         < Hello.c >
         
    3.  And wrote Android.mk like below.
         < Android.mk>
           
    4.  Ran 'make hello' and got hello executable file at build top directory.


[rk3288 target board]
         

There's no error with this method, but the biggest problem is that it takes too much time to compile.
So, I want to know how to use the compiler (arm-linux-androideabi-gcc) directly. eg. do I need environment variable setting?









Author: isle    Time: 3/9/2017 10:37
you can try NDK
Author: fireworks    Time: 3/13/2017 13:19
isle Posted at 3/9/2017 10:37
you can try NDK

Thank you for your tips.
I'll try NDK




Welcome Firefly Open Source Community (https://bbs.t-firefly.com/) Powered by Discuz! X3.1