配置:错误:在Linux Ubuntu上编译python for android时,C编译器无法创建可执行文件

2024-05-28 23:26:05 发布

您现在位置:Python中文网/ 问答频道 /正文

几天前,我已经为android创建了pyton文件夹,但是忘了包含一些模块。所以我只想再做一次。。。在

这是一个结果/分发.sh在

Python build finished, but the necessary bits to build these modules were not found:
_bsddb             _curses            _curses_panel   
_sqlite3           _ssl               _tkinter        
bsddb185           bz2                dbm             
gdbm               linuxaudiodev      ossaudiodev     
sunaudiodev                                           
To find the necessary bits, look in setup.py in detect_modules() for the module's name.


Failed to build these modules:
readline                                              

Call build_python
Entering in ARM environment
Compiler found at /home/pawel/.buildozer/android/platform/android-ndk-r9c//toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin//arm-linux-androideabi-gcc
configure: WARNING: if you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used
checking for --enable-universalsdk... no
checking for --with-universal-archs... 32-bit
checking MACHDEP... linux3
checking EXTRAPLATDIR... 
checking machine type as reported by uname -m... i686
checking for --without-gcc... no
checking for arm-eabi-gcc... ccache arm-linux-androideabi-gcc -DANDROID -mandroid  -fomit-frame-pointer --sysroot /home/pawel/.buildozer/android/platform/android-ndk-r9c//platforms/android-21/arch-arm
checking whether the C compiler works... no
configure: error: in `/home/pawel/python-for-android/build/python/Python-2.7.2':
configure: error: C compiler cannot create executables
See `config.log' for more details

这是结束配置日志公司名称:

^{pr2}$

这可能是最有趣的部分:

configure:3585: checking whether the C compiler works
configure:3607: ccache arm-linux-androideabi-gcc -DANDROID -mandroid  -fomit-frame-pointer --sysroot /home/pawel/.buildozer/android/platform/android-ndk-r9c//platforms/android-21/arch-arm -DANDROID -mandroid  -fomit-frame-pointer --sysroot /home/pawel/.buildozer/android/platform/android-ndk-r9c//platforms/android-21/arch-arm  -lm conftest.c  >&5
/home/pawel/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: cannot open crtbegin_dynamic.o: No such file or directory
/home/pawel/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: cannot open crtend_android.o: No such file or directory
/home/pawel/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lm
/home/pawel/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lc
/home/pawel/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: cannot find -ldl
collect2: error: ld returned 1 exit status
configure:3611: $? = 1
configure:3649: result: no

我已经在谷歌上搜索了好几个小时了。。所以现在我要问你

环境设置为:

export ANDROIDNDK="/home/user/.buildozer/android/platform/android-ndk-r9c/" 
export ANDROIDSDK="/home/user/.buildozer/android/platform/android-sdk-21/" 
export PATH=$ANDROIDNDK:$ANDROIDSDK/platform-tools:$ANDROIDSDK/tools:$PATH

导出ANDROIDAPI=21 导出ANDROIDNDKVER=r9c


Tags: homeforbinlinuxerrorarmandroidgcc

热门问题