2

引き継いだプロジェクトで使用されているAndroid::MutexとAndroid::AudioTrackのリンク時に、奇妙な未定義の参照が発生します。

誰かアイデアはありますか?含めるAndroid静的ライブラリはありませんか?

SharedLibrary:* * 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
4

2 に答える 2

4

これも私を悩ませました-しかし、私は最終的にBionicのヘッダー(bionic/libc/include)とリンクすることによってそれを解決しました-そして-重要な部分#define-'ing HAVE_PTHREADS(すなわちadd LOCAL_CFLAGS += HAVE_PTHREADS)。

于 2012-08-23T20:50:00.707 に答える
1

さて、これらはいくつかの奇妙なエラーです... android::Mutexまたはandroid::AudioTrackライブラリから何かを参照するたびに、リンカーはそれらの関数を見つけることができないようです。私が言えるのは、これらのライブラリはandroid標準ライブラリの一部ではないため、ビルドパスにそれらがあることを確認してください。そうでない場合は幸運を祈ります。

于 2012-06-11T19:28:16.830 に答える