Creating executable with NDK

2,061 views
Skip to first unread message

Mina Shokry

unread,
Sep 4, 2009, 6:58:12 PM9/4/09
to android-ndk
Hello,
Can I use NDK to build a native executable (not a library)?
I want to port an existing code that compiles to an executable. I am
not the writer of this code. So, digging into it and export functions
I need in a library isn't an easy task for me.

thanks in advance.

Pan

unread,
Sep 6, 2009, 11:53:25 PM9/6/09
to android-ndk
sure you can, read the NDK hello world doc to getting started.

Bytes

unread,
Sep 7, 2009, 12:41:27 AM9/7/09
to android-ndk
include $(BUILD_EXECUTABLE)

instead of

include $(BUILD_SHARED_LIBRARY)
> > thanks in advance.- Hide quoted text -
>
> - Show quoted text -

Mina Shokry

unread,
Sep 8, 2009, 4:09:41 AM9/8/09
to android-ndk
Thank you, it works.

but I still can not run the resulted executable on emulator.

I used "adb push" to move the executable to the sdcard and I tried to
run it but I got a "permission denied" message. The file doesn't have
an executable permission. chmod didn't help!
Is this because sdcard is formatted as FAT32? so, what a directory I
can move the file to to try?

thanks again.

David Turner

unread,
Sep 8, 2009, 9:19:13 AM9/8/09
to andro...@googlegroups.com
You cannot run executables from the SD Card's FAT partition. Very intentionally I might add.
You need to copy the file to another location (/data/misc maybe?)

Mina Shokry

unread,
Sep 11, 2009, 9:15:17 AM9/11/09
to android-ndk
thanks it works

On Sep 8, 3:19 pm, David Turner <di...@android.com> wrote:
> You cannot run executables from the SD Card's FAT partition. Very
> intentionally I might add.
> You need to copy the file to another location (/data/misc maybe?)
>
Reply all
Reply to author
Forward
0 new messages