Python-for-android: fatal error: stdlib.h: No such file or directory

Created on 8 Oct 2013  Â·  10Comments  Â·  Source: kivy/python-for-android

the output of the ./distribute.sh -x -m "openssl pil kivy" is here:
https://gist.github.com/anonymous/6878652

All 10 comments

Very commonly, when something's not found, you simply need to figure out
how to install it.

~ $ sudo find / -name 'stdlib.h'
should show
/usr/include/stdlib.h
somewhere in the output.

If it's not in the output, you maybe be using a distribution which doesn't
include files necessary to compile by default
~ $ sudo apt-get install build-essential
will take care of this on Ubuntu at least

Let us know how it goes.

On Mon, Oct 7, 2013 at 9:53 PM, Alice Ferrazzi [email protected]:

the output of the ./distribute.sh -x -m "openssl pil kivy" is here:
https://gist.github.com/anonymous/6878652

—
Reply to this email directly or view it on GitHubhttps://github.com/kivy/python-for-android/issues/159
.

Wait, I'm being silly. Android will include stdlib.h of its own as part of
the NDK.

~ $ sudo find / -name 'stdlib.h'

Will show, among many others:
/opt/android/ndk8/platforms/android-8/arch-arm/usr/include/stdlib.h

Installing the NDK should normally give you stdlib.h. Someone else may
know more about the specifics.

On Tue, Oct 8, 2013 at 12:57 AM, Knapper [email protected] wrote:

Very commonly, when something's not found, you simply need to figure out
how to install it.

~ $ sudo find / -name 'stdlib.h'
should show
/usr/include/stdlib.h
somewhere in the output.

If it's not in the output, you maybe be using a distribution which doesn't
include files necessary to compile by default
~ $ sudo apt-get install build-essential
will take care of this on Ubuntu at least

Let us know how it goes.

On Mon, Oct 7, 2013 at 9:53 PM, Alice Ferrazzi [email protected]:

the output of the ./distribute.sh -x -m "openssl pil kivy" is here:
https://gist.github.com/anonymous/6878652

—
Reply to this email directly or view it on GitHubhttps://github.com/kivy/python-for-android/issues/159
.

find . -name 'stdlib.h'
./android-ndk/platforms/android-14/arch-arm/usr/include/stdlib.h
./android-ndk/platforms/android-14/arch-mips/usr/include/stdlib.h
./android-ndk/platforms/android-14/arch-x86/usr/include/stdlib.h
./android-ndk/platforms/android-4/arch-arm/usr/include/stdlib.h
./android-ndk/platforms/android-5/arch-arm/usr/include/stdlib.h
./android-ndk/platforms/android-18/arch-arm/usr/include/stdlib.h
./android-ndk/platforms/android-18/arch-mips/usr/include/stdlib.h
./android-ndk/platforms/android-18/arch-x86/usr/include/stdlib.h
./android-ndk/platforms/android-9/arch-arm/usr/include/stdlib.h
./android-ndk/platforms/android-9/arch-mips/usr/include/stdlib.h
./android-ndk/platforms/android-9/arch-x86/usr/include/stdlib.h
./android-ndk/platforms/android-8/arch-arm/usr/include/stdlib.h
./android-ndk/platforms/android-3/arch-arm/usr/include/stdlib.h
./android-ndk/sources/android/support/include/stdlib.h
./android-ndk/sources/cxx-stl/stlport/stlport/stdlib.h
./android-ndk/sources/cxx-stl/gnu-libstdc++/4.6/include/tr1/stdlib.h
./android-ndk/sources/cxx-stl/gnu-libstdc++/4.7/include/tr1/stdlib.h
./android-ndk/sources/cxx-stl/gnu-libstdc++/4.8/include/tr1/stdlib.h
./android-ndk/sources/cxx-stl/gnu-libstdc++/4.4.3/include/tr1/stdlib.h

i found that file but how i link it ?

ANDROIDSDK=/opt/android-sdk-update-manager/
ANDROIDNDK=/opt/android-ndk/
ANDROIDAPI=17
ANDROIDNDKVER=r9

i have added also this "/opt/android-ndk//platforms/android-8/arch-arm/usr/include/" to my $PATH but still dosen't find it

You might stick with NDK R8e until we get to NDK9. Are there any features
of NDK 9 that you are sure you need? Also, building against newer Android
SDK's will limit your apps to only working on a fraction of devices. Not
sure if this is what you want. I'm using SDK8 and NDK8e atm.

On Tue, Oct 8, 2013 at 11:53 AM, Alice Ferrazzi [email protected]:

find . -name 'stdlib.h'
./android-ndk/platforms/android-14/arch-arm/usr/include/stdlib.h
./android-ndk/platforms/android-14/arch-mips/usr/include/stdlib.h
./android-ndk/platforms/android-14/arch-x86/usr/include/stdlib.h
./android-ndk/platforms/android-4/arch-arm/usr/include/stdlib.h
./android-ndk/platforms/android-5/arch-arm/usr/include/stdlib.h
./android-ndk/platforms/android-18/arch-arm/usr/include/stdlib.h
./android-ndk/platforms/android-18/arch-mips/usr/include/stdlib.h
./android-ndk/platforms/android-18/arch-x86/usr/include/stdlib.h
./android-ndk/platforms/android-9/arch-arm/usr/include/stdlib.h
./android-ndk/platforms/android-9/arch-mips/usr/include/stdlib.h
./android-ndk/platforms/android-9/arch-x86/usr/include/stdlib.h
./android-ndk/platforms/android-8/arch-arm/usr/include/stdlib.h
./android-ndk/platforms/android-3/arch-arm/usr/include/stdlib.h
./android-ndk/sources/android/support/include/stdlib.h
./android-ndk/sources/cxx-stl/stlport/stlport/stdlib.h
./android-ndk/sources/cxx-stl/gnu-libstdc++/4.6/include/tr1/stdlib.h
./android-ndk/sources/cxx-stl/gnu-libstdc++/4.7/include/tr1/stdlib.h
./android-ndk/sources/cxx-stl/gnu-libstdc++/4.8/include/tr1/stdlib.h
./android-ndk/sources/cxx-stl/gnu-libstdc++/4.4.3/include/tr1/stdlib.h

i found that file but how i link it ?

ANDROIDSDK=/opt/android-sdk-update-manager/
ANDROIDNDK=/opt/android-ndk/
ANDROIDAPI=17
ANDROIDNDKVER=r9

i have added also this
"/opt/android-ndk//platforms/android-8/arch-arm/usr/include/" but still
dosen't find it

—
Reply to this email directly or view it on GitHubhttps://github.com/kivy/python-for-android/issues/159#issuecomment-25907521
.

NDK 9 has an issue on github. Feel free to jump in.
https://github.com/kivy/python-for-android/issues/149

On Tue, Oct 8, 2013 at 11:59 AM, Knapper [email protected] wrote:

You might stick with NDK R8e until we get to NDK9. Are there any features
of NDK 9 that you are sure you need? Also, building against newer Android
SDK's will limit your apps to only working on a fraction of devices. Not
sure if this is what you want. I'm using SDK8 and NDK8e atm.

On Tue, Oct 8, 2013 at 11:53 AM, Alice Ferrazzi [email protected]:

find . -name 'stdlib.h'
./android-ndk/platforms/android-14/arch-arm/usr/include/stdlib.h
./android-ndk/platforms/android-14/arch-mips/usr/include/stdlib.h
./android-ndk/platforms/android-14/arch-x86/usr/include/stdlib.h
./android-ndk/platforms/android-4/arch-arm/usr/include/stdlib.h
./android-ndk/platforms/android-5/arch-arm/usr/include/stdlib.h
./android-ndk/platforms/android-18/arch-arm/usr/include/stdlib.h
./android-ndk/platforms/android-18/arch-mips/usr/include/stdlib.h
./android-ndk/platforms/android-18/arch-x86/usr/include/stdlib.h
./android-ndk/platforms/android-9/arch-arm/usr/include/stdlib.h
./android-ndk/platforms/android-9/arch-mips/usr/include/stdlib.h
./android-ndk/platforms/android-9/arch-x86/usr/include/stdlib.h
./android-ndk/platforms/android-8/arch-arm/usr/include/stdlib.h
./android-ndk/platforms/android-3/arch-arm/usr/include/stdlib.h
./android-ndk/sources/android/support/include/stdlib.h
./android-ndk/sources/cxx-stl/stlport/stlport/stdlib.h
./android-ndk/sources/cxx-stl/gnu-libstdc++/4.6/include/tr1/stdlib.h
./android-ndk/sources/cxx-stl/gnu-libstdc++/4.7/include/tr1/stdlib.h
./android-ndk/sources/cxx-stl/gnu-libstdc++/4.8/include/tr1/stdlib.h
./android-ndk/sources/cxx-stl/gnu-libstdc++/4.4.3/include/tr1/stdlib.h

i found that file but how i link it ?

ANDROIDSDK=/opt/android-sdk-update-manager/
ANDROIDNDK=/opt/android-ndk/
ANDROIDAPI=17
ANDROIDNDKVER=r9

i have added also this
"/opt/android-ndk//platforms/android-8/arch-arm/usr/include/" but still
dosen't find it

—
Reply to this email directly or view it on GitHubhttps://github.com/kivy/python-for-android/issues/159#issuecomment-25907521
.

i have added also this "/opt/android-ndk//platforms/android-8/arch-arm/usr/include/" to my $PATH but still dosen't find it

IIRC distribute.sh saves all of your environment variables and uses its own in order to build with the NDK tools instead of those installed for your system. Have a look at function push_arm() { on 118 in distribute.sh

after changing to NDK 8e i have also problem
Compile arm : jpeg <= jcapimin.c
/opt/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc -MMD -MP -MF /home/alice/python-for-android/src/obj/local/armeabi/objs/jpeg/jcapimin.o.d -fpic -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -march=armv5te -mtune=xscale -msoft-float -O2 -g -DNDEBUG -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300 -I/home/alice/python-for-android/src/jni/../jni/jpeg -DANDROID -DAVOID_TABLES -O3 -fstrict-aliasing -fprefetch-loop-arrays -Wa,--noexecstack -I/opt/android-ndk/platforms/android-14/arch-arm/usr/include -c /home/alice/python-for-android/src/jni/../jni/jpeg/jcapimin.c -o /home/alice/python-for-android/src/obj/local/armeabi/objs/jpeg/jcapimin.o
make: /opt/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc: Command not found
make: *** [/home/alice/python-for-android/src/obj/local/armeabi/objs/jpeg/jcapimin.o] Error 127

i have bin directory only in the linux-x86 folder not in the linux86_64 but my system is x86_64

Maybe you got the 32bit NDK? It's hard to find the right links. This one
works:
http://dl.google.com/android/ndk/android-ndk-r8e-linux-x86_64.tar.bz2

On Tue, Oct 8, 2013 at 7:07 PM, Alice Ferrazzi [email protected]:

i have bin directory only in the linux-x86 folder not in the linux86_64
but my system is x86_64

—
Reply to this email directly or view it on GitHubhttps://github.com/kivy/python-for-android/issues/159#issuecomment-25937975
.

yes was the 32bit thanks you
in the end i could compile using export ANDROIDAPI=14 and export ANDROIDNDKVER=r8e

Was this page helpful?
0 / 5 - 0 ratings