gpt4 book ai didi

Android NDK 找不到-lGLESv

转载 作者:塔克拉玛干 更新时间:2023-11-03 06:44:53 28 4
gpt4 key购买 nike

当我尝试执行 NDK 构建时出现以下错误,有人可以帮助我吗?

我按照“开始 Android C++ 游戏开发”中的内容进行了设置说明。除了第 9 步之外的每一步:

"Click the NativeActivity node in the Application Nodes window and click Add once more. Enter the Name as android.app.lib_name and the Value as the LOCAL_MODULE name, which can be found in the Android.mk file in the project’s jni folder."

错误:

10:44:23 ** Incremental Build of configuration Default for project HelloDroid ** "C:\ndk\ndk-build.cmd" all Android NDK: WARNING:jni/Android.mk:HelloDroid-Test: non-system libraries in linker flags: -lGLESv Android NDK: This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES Android NDK:
or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the Android NDK: current module [armeabi] SharedLibrary : libHelloDroid-Test.so C:/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: error: cannot find -lGLESv collect2: ld returned 1 exit status make.exe: * [obj/local/armeabi/libHelloDroid-Test.so] Error 1

10:44:23 Build Finished (took 226ms)

最佳答案

我发现了问题。我只需要编辑 Android.mk现在看起来像这样:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := hellodroid
LOCAL_SRC_FILES := hellodroid.cpp
LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv2
LOCAL_STATIC_LIBRARIES := android_native_app_glue

include $(BUILD_SHARED_LIBRARY)

$(call import-module, android/native_app_glue)

关于Android NDK 找不到-lGLESv,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23102112/

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