gpt4 book ai didi

Android NDK - 未定义对 Android::Mutex、Android::AudioTrack 的引用

转载 作者:行者123 更新时间:2023-11-29 16:13:53 26 4
gpt4 key购买 nike

在我接管的项目使用的 Android::Mutex 和 Android::AudioTrack 的链接时,我得到了奇怪的 undefined reference 。

有人有什么想法吗?没有要包含的 Android 静态库吗?

共享库:**jni.so

/Users/kevin/Desktop/player2/videoplayer/videoplayer/obj/local/armeabi-v7a/libamadec.a(android_out.o): In function `__static_initialization_and_destruction_0':
/Users/kevin/Desktop/player2/videoplayer/LibPlayer/amadec/audio_out/android_out.cpp:29: undefined reference to `android::Mutex::Mutex()'
/Users/kevin/Desktop/player2/videoplayer/LibPlayer/amadec/audio_out/android_out.cpp:29: undefined reference to `android::Mutex::~Mutex()'
/Users/kevin/Desktop/player2/videoplayer/videoplayer/obj/local/armeabi-v7a/libamadec.a(android_out.o): In function `Autolock':
/Android/source/frameworks/base/include/utils/threads.h:232: undefined reference to `android::Mutex::lock()'
/Users/kevin/Desktop/player2/videoplayer/videoplayer/obj/local/armeabi-v7a/libamadec.a(android_out.o): In function `~Autolock':
/Android/source/frameworks/base/include/utils/threads.h:234: undefined reference to `android::Mutex::unlock()'
/Users/kevin/Desktop/player2/videoplayer/videoplayer/obj/local/armeabi-v7a/libamadec.a(android_out.o): In function `Autolock':
/Android/source/frameworks/base/include/utils/threads.h:232: undefined reference to `android::Mutex::lock()'
/Users/kevin/Desktop/player2/videoplayer/videoplayer/obj/local/armeabi-v7a/libamadec.a(android_out.o): In function `android_mute':
/Users/kevin/Desktop/player2/videoplayer/LibPlayer/amadec/audio_out/android_out.cpp:263: undefined reference to `android::AudioTrack::mute(bool)'
/Users/kevin/Desktop/player2/videoplayer/videoplayer/obj/local/armeabi-v7a/libamadec.a(android_out.o): In function `~Autolock':
/Android/source/frameworks/base/include/utils/threads.h:234: undefined reference to `android::Mutex::unlock()'
/Android/source/frameworks/base/include/utils/threads.h:234: undefined reference to `android::Mutex::unlock()'
/Users/kevin/Desktop/player2/videoplayer/videoplayer/obj/local/armeabi-v7a/libamadec.a(android_out.o): In function `Autolock':
/Android/source/frameworks/base/include/utils/threads.h:232: undefined reference to `android::Mutex::lock()'
/Users/kevin/Desktop/player2/videoplayer/videoplayer/obj/local/armeabi-v7a/libamadec.a(android_out.o): In function `android_resume':
/Users/kevin/Desktop/player2/videoplayer/LibPlayer/amadec/audio_out/android_out.cpp:255: undefined reference to `android::AudioTrack::start()'
/Users/kevin/Desktop/player2/videoplayer/videoplayer/obj/local/armeabi-v7a/libamadec.a(android_out.o): In function `~Autolock':
/Android/source/frameworks/base/include/utils/threads.h:234: undefined reference to `android::Mutex::unlock()'
/Android/source/frameworks/base/include/utils/threads.h:234: undefined reference to `android::Mutex::unlock()'
/Users/kevin/Desktop/player2/videoplayer/videoplayer/obj/local/armeabi-v7a/libamadec.a(android_out.o): In function `Autolock':
/Android/source/frameworks/base/include/utils/threads.h:232: undefined reference to `android::Mutex::lock()'
/Users/kevin/Desktop/player2/videoplayer/videoplayer/obj/local/armeabi-v7a/libamadec.a(android_out.o): In function `android_pause':
/Users/kevin/Desktop/player2/videoplayer/LibPlayer/amadec/audio_out/android_out.cpp:247: undefined reference to `android::AudioTrack::pause()'
/Users/kevin/Desktop/player2/videoplayer/videoplayer/obj/local/armeabi-v7a/libamadec.a(android_out.o): In function `~Autolock':
/Android/source/frameworks/base/include/utils/threads.h:234: undefined reference to `android::Mutex::unlock()'
/Android/source/frameworks/base/include/utils/threads.h:234: undefined reference to `android::Mutex::unlock()'
/Users/kevin/Desktop/player2/videoplayer/videoplayer/obj/local/armeabi-v7a/libamadec.a(android_out.o): In function `android_get_delay':
/Users/kevin/Desktop/player2/videoplayer/LibPlayer/amadec/audio_out/android_out.cpp:237: undefined reference to `android::AudioTrack::latency() const'
/Users/kevin/Desktop/player2/videoplayer/videoplayer/obj/local/armeabi-v7a/libamadec.a(android_out.o): In function `Autolock':
/Android/source/frameworks/base/include/utils/threads.h:232: undefined reference to `android::Mutex::lock()'
/Users/kevin/Desktop/player2/videoplayer/videoplayer/obj/local/armeabi-v7a/libamadec.a(android_out.o): In function `android_uninit':
/Users/kevin/Desktop/player2/videoplayer/LibPlayer/amadec/audio_out/android_out.cpp:220: undefined reference to `android::AudioTrack::stop()'
/Users/kevin/Desktop/player2/videoplayer/LibPlayer/amadec/audio_out/android_out.cpp:228: undefined reference to `android::AudioTrack::~AudioTrack()'
/Users/kevin/Desktop/player2/videoplayer/videoplayer/obj/local/armeabi-v7a/libamadec.a(android_out.o): In function `~Autolock':
/Android/source/frameworks/base/include/utils/threads.h:234: undefined reference to `android::Mutex::unlock()'
/Users/kevin/Desktop/player2/videoplayer/videoplayer/obj/local/armeabi-v7a/libamadec.a(android_out.o): In function `Autolock':
/Android/source/frameworks/base/include/utils/threads.h:232: undefined reference to `android::Mutex::lock()'
/Users/kevin/Desktop/player2/videoplayer/videoplayer/obj/local/armeabi-v7a/libamadec.a(android_out.o): In function `android_start':
/Users/kevin/Desktop/player2/videoplayer/LibPlayer/amadec/audio_out/android_out.cpp:197: undefined reference to `android::AudioTrack::initCheck() const'
/Users/kevin/Desktop/player2/videoplayer/LibPlayer/amadec/audio_out/android_out.cpp:198: undefined reference to `android::AudioTrack::start()'
/Users/kevin/Desktop/player2/videoplayer/LibPlayer/amadec/audio_out/android_out.cpp:201: undefined reference to `android::AudioTrack::setVolume(float, float)'
/Users/kevin/Desktop/player2/videoplayer/videoplayer/obj/local/armeabi-v7a/libamadec.a(android_out.o): In function `~Autolock':
/Android/source/frameworks/base/include/utils/threads.h:234: undefined reference to `android::Mutex::unlock()'
/Users/kevin/Desktop/player2/videoplayer/videoplayer/obj/local/armeabi-v7a/libamadec.a(android_out.o): In function `android_start':
/Users/kevin/Desktop/player2/videoplayer/LibPlayer/amadec/audio_out/android_out.cpp:207: undefined reference to `android::AudioTrack::~AudioTrack()'
/Users/kevin/Desktop/player2/videoplayer/videoplayer/obj/local/armeabi-v7a/libamadec.a(android_out.o): In function `Autolock':
/Android/source/frameworks/base/include/utils/threads.h:232: undefined reference to `android::Mutex::lock()'
/Users/kevin/Desktop/player2/videoplayer/videoplayer/obj/local/armeabi-v7a/libamadec.a(android_out.o): In function `android_init':
/Users/kevin/Desktop/player2/videoplayer/LibPlayer/amadec/audio_out/android_out.cpp:122: undefined reference to `android::AudioTrack::AudioTrack()'
/Users/kevin/Desktop/player2/videoplayer/videoplayer/obj/local/armeabi-v7a/libamadec.a(android_out.o): In function `~Autolock':
/Android/source/frameworks/base/include/utils/threads.h:234: undefined reference to `android::Mutex::unlock()'
/Users/kevin/Desktop/player2/videoplayer/videoplayer/obj/local/armeabi-v7a/libamadec.a(android_out.o): In function `android_init':
/Users/kevin/Desktop/player2/videoplayer/LibPlayer/amadec/audio_out/android_out.cpp:139: undefined reference to `android::AudioTrack::set(int, unsigned int, int, int, int, unsigned int, void (*)(int, void*, void*), void*, int, android::sp<android::IMemory> const&, bool, int)'
/Users/kevin/Desktop/player2/videoplayer/videoplayer/obj/local/armeabi-v7a/libamadec.a(android_out.o): In function `~sp':
/Android/source/frameworks/base/include/utils/RefBase.h:378: undefined reference to `android::RefBase::decStrong(void const*) const'
collect2: ld returned 1 exit status

最佳答案

这也困扰着我 - 但我最终通过链接 Bionic 的 header (bionic/libc/include)和 - 重要部分 - #define 解决了这个问题ing HAVE_PTHREADS(即添加 LOCAL_CFLAGS += HAVE_PTHREADS)。

关于Android NDK - 未定义对 Android::Mutex、Android::AudioTrack 的引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10984001/

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