【问题标题】:Android NDK Cross Compile sys/signal.h: No such file or directoryAndroid NDK 交叉编译 sys/signal.h:没有这样的文件或目录
【发布时间】:2015-01-05 00:59:37
【问题描述】:

我正在用交叉编译编译 gdcm,但它给出了以下错误

sys/signal.h:没有这样的文件或目录(NDK没有那个我知道的)

但是有什么替代方法可以解决交叉编译库的错误。

In file included from /home/kirtan.patel/Desktop/GDCMMob/Build/Utilities/socketxx/socket++/config.h:135:0,
                 from /home/kirtan.patel/Desktop/GDCMMob/GDCMSource/Utilities/socketxx/socket++/sockstream.h:22,
                 from /home/kirtan.patel/Desktop/GDCMMob/GDCMSource/Utilities/socketxx/socket++/sockstream.cpp:49:
/home/kirtan.patel/Desktop/GDCMMob/GDCMSource/Utilities/socketxx/socket++/local.h:40:24: fatal error: sys/signal.h: No such file or directory
 #include <sys/signal.h>
                        ^
compilation terminated.
make[2]: *** [Utilities/socketxx/socket++/CMakeFiles/socketxx.dir/sockstream.cpp.o] Error 1
make[1]: *** [Utilities/socketxx/socket++/CMakeFiles/socketxx.dir/all] Error 2

【问题讨论】:

  • 你可以把你的 Android.mk 或 CmakeLists.
  • 嗨,Alex CMakeList 是正确的,但 #include 在 Android NDK 中不存在,因为我知道这一点,因为我可以为 Linux 编译相同的库,并且此错误仅在使用 android 的交叉编译器。

标签: android android-ndk cmake cross-compiling


【解决方案1】:

sys/signal.h 仅适用于最新的 Android NDK 和高于等于 21 的平台 (/android-ndk-r10e/platforms/android-21/arch-arm/usr/include/sys/signal.h )。

我在构建 RTKLib 时遇到了这个问题,并使用最新的工具链解决了这个问题。

谢谢, 喜满洲

【讨论】:

  • android-ndk-r16b 不包含包含文件夹,但是 android-ndk-14 有这个文件夹。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-02-26
  • 1970-01-01
  • 2012-01-28
相关资源
最近更新 更多