android ndk arm,c++ - Android NDK - arm-linux-androideabi-g++: not found - Stack Overflow

用户在新安装的Ubuntu上尝试为Android目标构建C++ POCO库,已将Android NDK路径添加到环境变量。使用`./configure`命令配置了POCO库以静态编译并排除不需要的模块,但运行`make`时遇到了找不到Android编译器的错误。错误提示是`arm-linux-androideabi-g++: not found`。用户不确定为何编译器未被找到,寻求解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

I am trying to build the C++ POCO library for an Android target in a fresh Ubuntu that I just installed for that.

I have installed the Android NDK in /home/user/dev/Android/android-ndk-r9-x86 and added the path to the NDK in the environement variables using :

export ANDROID_NDK_ROOT=/home/user/dev/Android/android-ndk-r9-x86

To build the libraries I first move to the root directory of the POCO library, and configure it using :

./configure --omit=NetSSL_OpenSSL,Crypto,Data/ODBC,Data/MySQL --static --config=Android

So that it compiles static .a libraries, doesn't compile the modules I don't want and compiles for an Android target.

But than calling make causes the following error :

user@user-VirtualBox:~/dev/Lib/POCO/poco-1.6.1$ make

make -C /home/user/dev/Lib/POCO/poco-1.6.1/Foundation

make[1]: Entering directory `/home/user/dev/Lib/POCO/poco-1.6.1/Foundation'

** Compiling src/ArchiveStrategy.cpp (debug, static)

arm-linux-androideabi-g++ -Iinclude -I/home/user/dev/Lib/POCO/poco-1.6.1/CppUnit/include -I/home/user/dev/Lib/POCO/poco-1.6.1/CppUnit/WinTestRunner/include -I/home/user/dev/Lib/POCO/poco-1.6.1/Foundation/include -I/home/user/dev/Lib/POCO/poco-1.6.1/XML/include -I/home/user/dev/Lib/POCO/poco-1.6.1/JSON/include -I/home/user/dev/Lib/POCO/poco-1.6.1/Util/include -I/home/user/dev/Lib/POCO/poco-1.6.1/Net/include -mthumb -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 -frtti -fexceptions -DPOCO_BUILD_HOST=user-VirtualBox -DPOCO_ANDROID -DPOCO_NO_FPENVIRONMENT -DPOCO_NO_WSTRING -DPOCO_NO_SHAREDMEMORY -g -D_DEBUG -c src/ArchiveStrategy.cpp -o /home/user/dev/Lib/POCO/poco-1.6.1/Foundation/obj/Android/armeabi/debug_static/ArchiveStrategy.o

sh: 1: arm-linux-androideabi-g++: not found

make[1]: *** [/home/user/dev/Lib/POCO/poco-1.6.1/Foundation/obj/Android/armeabi/debug_static/ArchiveStrategy.o] Error 127

make[1]: Leaving directory `/home/user/dev/Lib/POCO/poco-1.6.1/Foundation'

make: *** [Foundation-libexec] Error 2

Make seems unable to find the compiler used for Android, and I have no idea why ? What am I missing ? Did i forget something when "installing" the NDK ?

Thank you.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值