0

我正在尝试编译在此处找到的 Doom 代码。但是,当我运行 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)

任何人都能够看到我做错了什么?

4

1 回答 1

1

我相信您想将所有包含在LOCAL_C_INCLUDES变量中,而不是android-ndk 构建系统未使用的INC变量中。INC

这会将您的行更改为(注意已删除-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.
于 2013-05-09T15:31:58.710 回答