Tashen Jazbi
Tashen Jazbi

Reputation: 1068

Android ndk: utils/Log.h: No such file or directory compilation terminated

am compiling android ndk project but couldn't get it successfully done. It says no such file or directory found for Log header file at main.cpp file. I'm new to android ndk please help. here is my android.mk file.

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := user

LOCAL_ARM_MODE := arm

# This is the target being built.
LOCAL_MODULE := libemu

# All of the source files that we will compile.
LOCAL_SRC_FILES := \
    ticks.c \
    main.cpp \
    emulator.cpp

# All of the shared libraries we link against.
LOCAL_SHARED_LIBRARIES := \
    libdl \
    libnativehelper \
    libutils

# Static libraries.
LOCAL_STATIC_LIBRARIES :=

# Also need the JNI headers.
LOCAL_C_INCLUDES += \
    $(JNI_H_INCLUDE)

# Special compiler flags.
LOCAL_CFLAGS += -O3 -fvisibility=hidden

# Don't prelink this library.  For more efficient code, you may want
# to add this library to the prelink map and set this to true. However,
# it's difficult to do this for applications that are not supplied as
# part of a system image.

LOCAL_PRELINK_MODULE := false

include $(BUILD_SHARED_LIBRARY)

here is the log

"Compile++ arm  : emu <= main.cpp
D:/EclipseWorkspace/NineTendo//jni/main.cpp:2:23: fatal error: utils/Log.h: No such file or directory
compilation terminated.
make: *** [D:/EclipseWorkspace/NineTendo//obj/local/armeabi/objs/emu/main.o] Error 1

any help would be much appreciated. Thanks

Upvotes: 1

Views: 7512

Answers (1)

BitBank
BitBank

Reputation: 8715

This error started to show up in NDK version R9x. You need to declare the API version number in your Application.mk file. Here's how it looks to define a minimum API level of 8:

APP_PLATFORM := android-8

The Application.mk file should live alongside your Android.mk file in the JNI directory. Here's a sample from one of my projects:

APP_ABI := armeabi armeabi-v7a x86
APP_CFLAGS += -O2
LOCAL_ARM_MODE  := arm
APP_PLATFORM := android-8

Upvotes: 2

Related Questions