嗨,我正在尝试将 Ubuntu 64 上的 Android arm16.04 代码与 android-ndk 的 gcc-4.9 交叉编译,但无法摆脱此错误:
aarch64-linux-android-gcc -o test.o -c test.c -Os -fPIE -Wall -DDBG
test.c:26:18: fatal error: poll.h: No such file or directory
#include <poll.h>
^
compilation terminated.
Makefile:16: recipe for target 'test.o' failed
make: *** [test.o] Error 1
我认为这是因为无法以正确的方式访问工具链,因为在我得到之前:
make: aarch64-linux-android-as: Command not found
请指教。
谢谢yugr,把它变成独立的解决了它:
$NDK/build/tools/make_standalone_toolchain.py
--arch arm64 --api 23 --install-dir /tmp/my-android-toolchain
之后,我将/tmp/my-android-toolchain/bin
添加到PATH中,它起作用了。