gpt4 book ai didi

Android ndk : utils/Log. h: 没有这样的文件或目录编译终止

转载 作者:行者123 更新时间:2023-11-30 04:08:32 52 4
gpt4 key购买 nike

正在编译 android ndk 项目,但无法成功完成。它说在 main.cpp 文件中找不到 Log 头文件的此类文件或目录。我是 android ndk 的新手,请帮忙。这是我的 android.mk 文件。

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)

这是日志

"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

任何帮助将不胜感激。谢谢

最佳答案

此错误开始出现在 NDK 版本 R9x 中。您需要在 Application.mk 文件中声明 API 版本号。以下是定义最低 API 级别 8 的方式:

APP_PLATFORM := android-8

Application.mk 文件应该与您的 Android.mk 文件一起存在于 JNI 目录中。这是我的一个项目的示例:

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

关于Android ndk : utils/Log. h: 没有这样的文件或目录编译终止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21782981/

52 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com