Android Binder 构建错误 - 错误:未定义对 'android::defaultServiceManager() 的引用
需要您的支持来解决我使用活页夹构建示例“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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了构建错误的修复。
将共享活页夹 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.