esio
unread,Jul 27, 2011, 7:00:28 AM7/27/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to android-ndk, zade...@gmail.com
Hi!
I am trying compile code with the x86 Android NDK. Unfortunely, this
is a multiplatform application.
On Linux, I compile using CMake scripts and the android and I want to
use them. I can compile my application if I have access to sources of
android and I use Android.mk but this solution does not satisfy me. I
would like to compile using only NDK, without Android sources.
I have:
1. standalone toolchain, created by $NDK/build/tools/make-standalone-
toolchain.sh --platform=android-9 --install-dir=/tmp/my-android-
toolchain --arch=x86
2. Toolchain.cmake file:
set(toolchain_path /opt/android-toolchain)
include(CMakeForceCompiler)
set(CMAKE_C_COMPILER ${toolchain_path}/bin/i686-android-linux-gcc -
nostdlib)
set(CMAKE_CXX_COMPILER ${toolchain_path}/bin/i686-android-linux-g++ -
nostdlib)
set(CMAKE_FIND_ROOT_PATH ${toolchain_path})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
When compiling I've got the following error:
-- Check for working CXX compiler: /opt/android-toolchain/bin/i686-
android-linux-g++
-- Check for working CXX compiler: /opt/android-toolchain/bin/i686-
android-linux-g++ -- broken
CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCXXCompiler.cmake:
45 (MESSAGE):
The C++ compiler "/opt/android-toolchain/bin/i686-android-linux-g++"
is not
able to compile a simple test program.
I can compile a simple program using the NDK, but I have a problem
when compiling larger programs. I compile simple "Hello World" code
using this way:
/opt/android-toolchain/bin/i686-android-linux-gcc --sysroot=~/
Downloads/android-ndk-r6/platforms/android-9/arch-x86/ hw.c -nostdlib
and I recives warining:
/user/geliszew/Downloads/android-ndk-r6/toolchains/x86-4.4.3/prebuilt/
linux-x86/bin/../lib/gcc/i686-android-linux/4.4.3/../../../../i686-
android-linux/bin/ld: warning: cannot find entry symbol _start;
defaulting to 08048074
cat hw.c:
main() { return 0; }
System: Ubuntu 10.10 x64, kernel 2.6.35-22-generic
NDK-r6
Is anyone help me?