Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fatal error:android/log.h:no such file or directory. #2

Open
zhouchuanping opened this issue Sep 11, 2018 · 1 comment
Open

fatal error:android/log.h:no such file or directory. #2

zhouchuanping opened this issue Sep 11, 2018 · 1 comment

Comments

@zhouchuanping
Copy link

When I build ndcrash a static library by cmake,It report a error:ndcrash_log.h:3:25 fatal error:android/log.h:no such file or directory.How can i solve it?
My Cmake Version is 2.8.12.2,my SDK version is r16.

@ivanarh
Copy link
Owner

ivanarh commented Sep 12, 2018

It seems like you tried to build it for desktop operating system without a proper Android toolchain.
Please try something like that:

mkdir build
cd build
${ANDROID_HOME}/cmake/3.6.4111459/bin/cmake \
-Wno-dev \
-DCMAKE_SYSTEM_NAME=Android \
-DANDROID_PLATFORM=android-14 \
-DANDROID_ABI=armeabi-v7a \
-DANDROID_NDK=${ANDROID_NDK_ROOT} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake \
-DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DENABLE_LIBCORKSCREW=ON \
-DENABLE_LIBUNWIND=ON \
-DENABLE_LIBUNWINDSTACK=ON \
-DENABLE_CXXABI=ON \
-DENABLE_STACKSCAN=ON \
-DENABLE_INPROCESS=ON \
-DENABLE_OUTOFPROCESS=ON \
..
make

ANDROID_HOME variable should point to Android SDK location.
ANDROID_NDK_ROOT variable should point to Android NDK location.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants