gpt4 book ai didi

android - ROLI JUCE Android CMake 错误,生成的空白演示应用程序无法在 Android Studio 中编译

转载 作者:行者123 更新时间:2023-11-28 04:29:31 27 4
gpt4 key购买 nike

下载 Projucer 后我生成了一个空白应用程序,我将它导出到 Android(在 Debug模式下)并在 Android studio 中打开它。修复与 SDK 和 NDK 版本有关的错误后(我更新了引用以使用最新版本构建),代码无法在 CMake 阶段构建,并显示以下错误输出:

Build command failed.
Error while executing process /Users/user/Library/Android/sdk/cmake/3.6.4111459/bin/cmake with arguments {--build /Users/user/Documents/Blank/Builds/Android/app/.externalNativeBuild/cmake/debug_Debug/x86 --target juce_jni}
[1/16] Building C object CMakeFiles/cpufeatures.dir/Users/user/Library/Android/sdk/ndk-bundle/sources/android/cpufeatures/cpu-features.c.o
[2/16] Linking C static library libcpufeatures.a
[3/16] Building CXX object CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_audio_basics.cpp.o
[4/16] Building CXX object CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_audio_devices.cpp.o
[5/16] Building CXX object CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_audio_formats.cpp.o
[6/16] Building CXX object CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_audio_processors.cpp.o
[7/16] Building CXX object CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_core.cpp.o
[8/16] Building CXX object CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_cryptography.cpp.o
[9/16] Building CXX object CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_data_structures.cpp.o
[10/16] Building CXX object CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_events.cpp.o
[11/16] Building CXX object CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_graphics.cpp.o
[12/16] Building CXX object CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_gui_basics.cpp.o
[13/16] Building CXX object CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_gui_extra.cpp.o
[14/16] Building CXX object CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_opengl.cpp.o
FAILED: /Users/user/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=i686-none-linux-android28 --gcc-toolchain=/Users/user/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64 -DDEBUG=1 -DJUCER_ANDROIDSTUDIO_7F0E4A25=1 -DJUCE_ANDROID=1 -DJUCE_ANDROID_ACTIVITY_CLASSNAME=com_yourcompany_blank_Blank -DJUCE_ANDROID_ACTIVITY_CLASSPATH=\"com/yourcompany/blank/Blank\" -DJUCE_ANDROID_API_VERSION=10 -DJUCE_ANDROID_SHARING_CONTENT_PROVIDER_CLASSNAME=com_yourcompany_blank_SharingContentProvider -DJUCE_ANDROID_SHARING_CONTENT_PROVIDER_CLASSPATH=\"com/yourcompany/blank/SharingContentProvider\" -DJUCE_APP_VERSION=1.0.0 -DJUCE_APP_VERSION_HEX=0x10000 -DJUCE_PUSH_NOTIFICATIONS=1 -D_DEBUG=1 -Djuce_jni_EXPORTS -I../../../../../../../JuceLibraryCode -I/Users/user/Downloads/JUCE/modules -I/Users/molly/Library/Android/sdk/ndk-bundle/sources/android/cpufeatures --sysroot /Users/user/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -stdlib=libc++ -std=c++11 -fexceptions -frtti -fsigned-char -std=c++14 -O0 -fno-limit-debug-info -O0 -fPIC -MD -MT CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_opengl.cpp.o -MF CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_opengl.cpp.o.d -o CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_opengl.cpp.o -c /Users/user/Documents/Blank/JuceLibraryCode/include_juce_opengl.cpp
In file included from /Users/user/Documents/Blank/JuceLibraryCode/include_juce_opengl.cpp:9:
/Users/user/Downloads/JUCE/modules/juce_opengl/juce_opengl.cpp:118:26: error: no member named 'glDrawBuffer' in the global namespace; did you mean simply 'glDrawBuffer'?
JUCE_GL_BASE_FUNCTIONS (JUCE_DECLARE_GL_FUNCTION)
~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/user/Downloads/JUCE/modules/juce_opengl/native/juce_OpenGLExtensions.h:69:5: note: expanded from macro 'JUCE_GL_BASE_FUNCTIONS'
USE_FUNCTION (glDrawBuffer, void, (GLsizei p1, const GLenum* p2), (p1, p2))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/user/Downloads/JUCE/modules/juce_opengl/juce_opengl.cpp:116:72: note: expanded from macro 'JUCE_DECLARE_GL_FUNCTION'
returnType OpenGLExtensionFunctions::name params noexcept { return ::name callparams; }
^~
/Users/user/Downloads/JUCE/modules/juce_opengl/juce_opengl.cpp:118:2: note: 'glDrawBuffer' declared here
JUCE_GL_BASE_FUNCTIONS (JUCE_DECLARE_GL_FUNCTION)
^
/Users/user/Downloads/JUCE/modules/juce_opengl/native/juce_OpenGLExtensions.h:69:19: note: expanded from macro 'JUCE_GL_BASE_FUNCTIONS'
USE_FUNCTION (glDrawBuffer, void, (GLsizei p1, const GLenum* p2), (p1, p2))
^
1 error generated.
ninja: build stopped: subcommand failed.

我曾尝试重新安装 Projucer、运行不同版本的 Android Studio 并生成不同的演示项目,但它们都在同一点失败。在同一台计算机 (macOS) 上生成 Xcode 文件并下载相同的 Projucer 时,代码会在模拟的 iOS 上编译和运行。

我是否遗漏了某些库或某个地方的文件路径不正确?

引发错误的文件来自他们自己的库,所以我不确定是什么导致了这个问题,我们将不胜感激!

错误特别发生在 USE_FUCNTION(glDrawBuffer ...) 行,因为我尝试在库文件中移动这行代码并且错误随之移动(它在代码块的末尾所以我想看看是不是那个代码块失败了,但它似乎特别是那一行)

最佳答案

将 Android 导出器中的“最低 SDK 版本”设置为 24 之类的值,而不是默认值 10。

当前的默认值有点低,在下一个 JUCE 版本中将提高到 28。

关于android - ROLI JUCE Android CMake 错误,生成的空白演示应用程序无法在 Android Studio 中编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53298766/

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