对 android::LPAPlayer::* 的未定义引用
Undefined Reference to android::LPAPlayer::*
我在为基于 MSM7x27A/Snapdragon S1 平台的不受支持的设备编译 CyanogenMod 11(Android 4.4) 时遇到了很大困难。当我尝试构建 libstagefright 时,我想到 android::LPAPlayer::* 中函数的未定义引用错误,包括构造函数。我得到的错误是:
Copying: /home/dyngar-f/android/android/out/target/common/obj/JAVA_LIBRARIES/mms-common_intermediates/noproguard.classes.jar
frameworks/av/media/libstagefright/AwesomePlayer.cpp:1282: error: undefined reference to 'android::LPAPlayer::LPAPlayer(android::sp<android::MediaPlayerBase::AudioSink> const&, bool&, android::AwesomePlayer*)'
frameworks/av/media/libstagefright/AwesomePlayer.cpp:1306: error: undefined reference to 'android::LPAPlayer::mObjectsAlive'
frameworks/av/media/libstagefright/AwesomePlayer.cpp:1882: error: undefined reference to 'android::LPAPlayer::mObjectsAlive'
collect2: error: ld returned 1 exit statusbuild/core/shared_library.mk:81: recipe for target '/home/dyngar-f/android/android/out/target/product/schS738c/obj/SHARED_LIBRARIES/libstagefright_intermediates/LINKED/libstagefright.so' failed
make: *** [/home/dyngar-f/android/android/out/target/product/schS738c/obj/SHARED_LIBRARIES/libstagefright_intermediates/LINKED/libstagefright.so] Error 1make: *** Waiting for unfinished jobs....
我到处搜索,没有发现导致我解决此问题的错误,而且我自己也没有找到解决方案。以下是我从其他人那里找到的关于这个问题的参考资料:
Gist from CMartinBaughman
Mentioned in XDA Thread 此页面上还有一个答案似乎无效。
谁能指导我解决这个问题?
错误来自链接器,它无法找到对 LPAPlayer
的引用,这实际上是 CyanogenMod
源中的自定义。从最新的树中,Android.mk
for libstagefright
不包括 LPAPlayer.cpp
所有平台。
要解决您的问题,请尝试在 Android.mk
行 114-117
之间添加以下文件
#New lines included
ifeq ($(call is-chipset-in-board-platform,msm7x27),true)
LOCAL_SRC_FILES += LPAPlayer.cpp
LOCAL_CFLAGS += -DLEGACY_LPA -DUSE_LPA_MODE
endif
ifeq ($(call is-chipset-in-board-platform,msm7x30),true)
LOCAL_SRC_FILES += LPAPlayer.cpp
LOCAL_CFLAGS += -DLEGACY_LPA -DUSE_LPA_MODE
endif
平台名称可能需要修改以适合实际名称(请参考BoardConfig.mk
)。
我在为基于 MSM7x27A/Snapdragon S1 平台的不受支持的设备编译 CyanogenMod 11(Android 4.4) 时遇到了很大困难。当我尝试构建 libstagefright 时,我想到 android::LPAPlayer::* 中函数的未定义引用错误,包括构造函数。我得到的错误是:
Copying: /home/dyngar-f/android/android/out/target/common/obj/JAVA_LIBRARIES/mms-common_intermediates/noproguard.classes.jar
frameworks/av/media/libstagefright/AwesomePlayer.cpp:1282: error: undefined reference to 'android::LPAPlayer::LPAPlayer(android::sp<android::MediaPlayerBase::AudioSink> const&, bool&, android::AwesomePlayer*)'
frameworks/av/media/libstagefright/AwesomePlayer.cpp:1306: error: undefined reference to 'android::LPAPlayer::mObjectsAlive'
frameworks/av/media/libstagefright/AwesomePlayer.cpp:1882: error: undefined reference to 'android::LPAPlayer::mObjectsAlive'
collect2: error: ld returned 1 exit statusbuild/core/shared_library.mk:81: recipe for target '/home/dyngar-f/android/android/out/target/product/schS738c/obj/SHARED_LIBRARIES/libstagefright_intermediates/LINKED/libstagefright.so' failed
make: *** [/home/dyngar-f/android/android/out/target/product/schS738c/obj/SHARED_LIBRARIES/libstagefright_intermediates/LINKED/libstagefright.so] Error 1make: *** Waiting for unfinished jobs....
我到处搜索,没有发现导致我解决此问题的错误,而且我自己也没有找到解决方案。以下是我从其他人那里找到的关于这个问题的参考资料:
Gist from CMartinBaughman
Mentioned in XDA Thread 此页面上还有一个答案似乎无效。
谁能指导我解决这个问题?
错误来自链接器,它无法找到对 LPAPlayer
的引用,这实际上是 CyanogenMod
源中的自定义。从最新的树中,Android.mk
for libstagefright
不包括 LPAPlayer.cpp
所有平台。
要解决您的问题,请尝试在 Android.mk
行 114-117
#New lines included
ifeq ($(call is-chipset-in-board-platform,msm7x27),true)
LOCAL_SRC_FILES += LPAPlayer.cpp
LOCAL_CFLAGS += -DLEGACY_LPA -DUSE_LPA_MODE
endif
ifeq ($(call is-chipset-in-board-platform,msm7x30),true)
LOCAL_SRC_FILES += LPAPlayer.cpp
LOCAL_CFLAGS += -DLEGACY_LPA -DUSE_LPA_MODE
endif
平台名称可能需要修改以适合实际名称(请参考BoardConfig.mk
)。