gpt4 book ai didi

android - 使用 C++ 的 NativeActivity

转载 作者:行者123 更新时间:2023-11-30 02:50:34 33 4
gpt4 key购买 nike

我尝试仅使用 C++ 将我的所有应用程序从 IOS 和 ANDROID 与 JAVA EGL 移植到 Android 设备上。

我刚刚遇到的一件事是“ fatal error :android_native_app_glue.h:没有这样的文件或目录”所以我要检查我的 make 文件,下面的“Android.mk”

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_DEFAULT_CPP_EXTENSION := cpp
LOCAL_MODULE := StarEngine


LOCAL_SRC_FILES := \
main.cpp \
StarEngine.cpp \
../../../StarEngine/StarShader.cpp \
../../../StarEngine/StarTexture.cpp \
../../../StarEngine/StarFBO.cpp\
../../../StarEngine/StarTimer.cpp\
../../../StarEngine/StarMath/Matrix.cpp\
../../../StarEngine/StarMath/Random.cpp\
../../../StarEngine/StarMath/Transform.cpp\
../../../StarEngine/StarMath/Vector.cpp\
../../../StarEngine/StarMath/neonmath/neon_matrix_impl.cpp\
../../../StarEngine/StarMath/vfpmath/matrix_impl.cpp\
../../../StarEngine/StarMath/vfpmath/utility_impl.cpp\
#../../../StarEngine/StarSound/StarSound.cpp

ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
LOCAL_CFLAGS := -D_ARM_ARCH_7=1
LOCAL_CPPFLAGS := -D_ARM_ARCH_7=1
else

endif


LOCAL_CFLAGS := -DCONFIG_EMBEDDED -DUSE_IND_THREAD -marm -mfpu=neon -mfloat-abi=softfp
APP_STL := stlport_static

LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog -ldl -lGLESv2 -landroid -lEGL -lGLESv1_CM


LOCAL_STATIC_LIBRARIES := android_native_app_glue cpufeatures
include $(BUILD_SHARED_LIBRARY)
$(call import-module,cpufeatures,android/native_app_glue)

最佳答案

回答:

当你使用两个以上的静态库时,你应该像这样放置 import-module 两次以上

include $(BUILD_SHARED_LIBRARY)
$(call import-module,android/native_app_glue)
$(call import-module,cpufeatures)

根据NDK文件夹中的引用:

 import-module

A function that allows you to find and include the Android.mk
of another module by name. A typical example is:

$(call import-module,<name>)

And this will look for the module tagged <name> in the list of
directories referenced by your NDK_MODULE_PATH environment
variable, and include its Android.mk automatically for you.

关于android - 使用 C++ 的 NativeActivity,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20374820/

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