W
W
wolf-98302014-03-13 16:12:41
Android
wolf-9830, 2014-03-13 16:12:41

How to include .hpp files in my native project?

Hello, dear users of the site toster.ru.
How do I include .hpp files in my native android (SDL 2) project? Or rather, what to write in the android.mk file?

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := main

SDL_PATH := ../SDL
SDL_IMAGE_PATH := ../SDL2_image-2.0.0
SDL_MIXER_PATH := ../SDL_mixer
SDL_TTF_PATH := ../SDL_ttf

LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDL_PATH)/include \
        $(LOCAL_PATH)/$(SDL_IMAGE_PATH)/ \
        $(LOCAL_PATH)/$(SDL_MIXER_PATH)/ \
        $(LOCAL_PATH)/$(SDL_TTF_PATH)/ 

# Add your application source files here...
LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.c \
                          main.cpp \
                          CCore.cpp \ 

LOCAL_SHARED_LIBRARIES := SDL2 \
              SDL2_image \
              SDL2_mixer \
              SDL2_ttf 

LOCAL_LDLIBS := -lGLESv1_CM -llog

include $(BUILD_SHARED_LIBRARY)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
EXL, 2014-03-13
@wolf-9830

MY_HEADER_PATH := ../src/headers

LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDL_PATH)/include \
        $(LOCAL_PATH)/$(SDL_IMAGE_PATH)/ \
        $(LOCAL_PATH)/$(SDL_MIXER_PATH)/ \
        $(LOCAL_PATH)/$(SDL_TTF_PATH)/ \
                                $(LOCAL_PATH)/$(MY_HEADER_PATH)/

After that, the header files from the "../src/headers" directory should appear normally.
But read carefully the Android NDK documentation, in particular, there may be a variable LOCAL_CХХ_INCLUDES :=orLOCAL_CPP_INCLUDES :=

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question