尝试在macOS High Sierra上使用Android NDK编译C ++库时找不到CMake pthread.h

时间:2018-07-04 12:18:58

标签: android c++ cmake android-ndk dlib

我正在尝试使用NDKandroid-toolchain来编译dlib库。我不断出现以下错误

  

在/Users/abhishek/Development/AndroidSDK/sdk/cmake/3.6.4111459/share/cmake-3.6/Modules/FindPackageHandleStandardArgs.cmake上的CMake错误:148(消息):     找不到线程(缺少:Threads_FOUND)   呼叫堆栈(最近的呼叫优先):     /Users/abhishek/Development/AndroidSDK/sdk/cmake/3.6.4111459/share/cmake-3.6/Modules/FindPackageHandleStandardArgs.cmake:388(_FPHSA_FAILURE_MESSAGE)     /Users/abhishek/Development/AndroidSDK/sdk/cmake/3.6.4111459/share/cmake-3.6/Modules/FindThreads.cmake:223(FIND_PACKAGE_HANDLE_STANDARD_ARGS)     dlib / CMakeLists.txt:195(find_package)

我通过SDK管理器安装了最新的NDK(版本17)。这是我运行CMake的方式

$ANDROID_CMAKE \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=/Users/abhishek/Development/AndroidSDK/sdk/cmake/3.6.4111459/android.toolchain.cmake \
-DCMAKE_INSTALL_PREFIX=/Users/abhishek/Development/ThirdParty/dlib19_1/install/armeabi-v7a \
-DANDROID_NDK=$ANDROID_NDK_HOME \
-DANDROID_TOOLCHAIN=gcc \
-DANDROID_ABI=armeabi-v7a \
-DANDROID_NATIVE_API_LEVEL=16 \
-DANDROID_LINKER_FLAGS="-landroid -llog" \
-DANDROID_STL=c++_shared \
-DANDROID_CPP_FEATURES="rtti exceptions" \
../..

这是已安装的gcc

的详细信息
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

我一直在关注this tutorial

让我知道是否需要更多信息。

0 个答案:

没有答案