gpt4 book ai didi

Android:引用头文件时出现问题

转载 作者:行者123 更新时间:2023-11-30 15:49:03 30 4
gpt4 key购买 nike

我正在尝试编译发现的 Doom 代码 Here 。但是,当我运行 ndk-build 时,我看到以下内容...

jni/droid/i_video.c:45:17: fatal error: SDL.h: No such file or directory

但是...

find ./ -name SDL.h
.//SDL-1.2.13/include/SDL.h

我的 Android.mk 显示...

DOOM := apps/Doom/project/jni
INC := -I$(DOOM) -I$(DOOM)/include -I$(DOOM)/SDL-1.2.13/include
LOCAL_CFLAGS := $(DOOM_FLAGS) $(OPTS) $(INC)

有人能看出我做错了什么吗?

最佳答案

我相信您希望将所有包含内容放入LOCAL_C_INCLUDES变量中,而不是INC变量中,因为INC未被android使用-ndk构建系统。

这会将您的行更改为(注意删除的 -I)

LOCAL_C_INCLUDES := $(DOOM) $(DOOM)/include $(DOOM)/SDL-1.2.13/include

下面引用了 LOCAL_C_INCLUDES 的相关部分

LOCAL_C_INCLUDES
An optional list of paths, relative to the NDK *root* directory,
which will be appended to the include search path when compiling
all sources (C, C++ and Assembly). For example:

LOCAL_C_INCLUDES := sources/foo

Or even:

LOCAL_C_INCLUDES := $(LOCAL_PATH)/../foo

These are placed before any corresponding inclusion flag in
LOCAL_CFLAGS / LOCAL_CPPFLAGS

The LOCAL_C_INCLUDES path are also used automatically when
launching native debugging with ndk-gdb.

关于Android:引用头文件时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16463851/

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