Android Binder 构建错误 - 错误:未定义对 'android::defaultServiceManager() 的引用

发布于 2024-12-10 08:14:57 字数 1811 浏览 0 评论 0原文

需要您的支持来解决我使用活页夹构建示例“HelloWorldService”程序的问题。

在使用 make 构建时,我收到以下错误。

target Executable: helloworldclient (out/target/product/pandaboard/obj/EXECUTABLES/helloworldclient_intermediates/LINKED/helloworldclient)
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/pandaboard/obj/lib/libhelloworldservice.so: error: undefined reference to 'android::BBinder::BBinder()'
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/pandaboard/obj/lib/libhelloworldservice.so: error: undefined reference to 'android::Parcel::enforceInterface(android::String16 const&, android::IPCThreadState*) const'
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/pandaboard/obj/lib/libhelloworldservice.so: error: undefined reference to 'android::Parcel::readCString() const'
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/pandaboard/obj/lib/libhelloworldservice.so: error: undefined reference to 'android::Parcel::writeCString(char const*)'
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/pandaboard/obj/EXECUTABLES/helloworldclient_intermediates/main_helloworldclient.o: in function main:packages/apps/HelloWorldService/helloworldclient/main_helloworldclient.cpp:24: error: undefined reference to 'android::defaultServiceManager()'
collect2: ld returned 1 exit status
make: *** [out/target/product/pandaboard/obj/EXECUTABLES/helloworldclient_intermediates/LINKED/helloworldclient] Error 1

请帮我解决这个问题,如果需要详细信息,请告诉我。

Need your support to solve my problem to build sample "HelloWorldService" program with binder.

While building using make I am getting following errors.

target Executable: helloworldclient (out/target/product/pandaboard/obj/EXECUTABLES/helloworldclient_intermediates/LINKED/helloworldclient)
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/pandaboard/obj/lib/libhelloworldservice.so: error: undefined reference to 'android::BBinder::BBinder()'
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/pandaboard/obj/lib/libhelloworldservice.so: error: undefined reference to 'android::Parcel::enforceInterface(android::String16 const&, android::IPCThreadState*) const'
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/pandaboard/obj/lib/libhelloworldservice.so: error: undefined reference to 'android::Parcel::readCString() const'
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/pandaboard/obj/lib/libhelloworldservice.so: error: undefined reference to 'android::Parcel::writeCString(char const*)'
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/pandaboard/obj/EXECUTABLES/helloworldclient_intermediates/main_helloworldclient.o: in function main:packages/apps/HelloWorldService/helloworldclient/main_helloworldclient.cpp:24: error: undefined reference to 'android::defaultServiceManager()'
collect2: ld returned 1 exit status
make: *** [out/target/product/pandaboard/obj/EXECUTABLES/helloworldclient_intermediates/LINKED/helloworldclient] Error 1

Please help me to fix this issue, Let me know if detailed info is required.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

青衫负雪 2024-12-17 08:14:57

我找到了构建错误的修复。

将共享活页夹 lib 条目添加到我的 Android.mk 文件

LOCAL_SHARED_LIBRARIES += libbinder

能够构建而不会出现任何错误。

I found the Fix for the Build error.

Added the shared binder lib entry to my Android.mk file

"LOCAL_SHARED_LIBRARIES += libbinder"

Able to build without any error.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文