- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在从 Qt (Ubuntu 19.10 - 5.12.3) 交叉编译到 Raspberry Pi 3B+ (stetch)。我已经成功做到了,我能够运行从 Qt 到 Raspberry 的应用程序。
现在我想使用通过 protoc( Protocol Buffer )获得的 .h 和 .cc 文件部署和执行应用程序。
所以首先我在我的笔记本电脑上安装了 Protocol Buffer 3.10.1...我创建了 .h 和 .cc 文件然后在 Qt 中我将它们添加到我的项目中( untitled.pro).
在我用这个配置重复操作之后:
./configure --host=arm-linux CC=/home/belfix/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc CXX=/home/belfix/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++
通过这种方式,我获得了树莓派所需的 libprotobuf.a...在 Qt untitled.pro 中,我添加了以下行:
unix:!macx: LIBS += -L$$PWD/../../../usr/local/lib/ -lprotobuf
INCLUDEPATH += $$PWD/../../../usr/local/include
DEPENDPATH += $$PWD/../../../usr/local/include
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../usr/local/lib/libprotobuf.a
程序构建和部署但是......当我按运行时我遇到了这个错误
/home/pi/untitled/bin/untitled: symbol lookup error:/home/pi/untitled/bin/untitled: undefined symbol: _ZN6google8protobuf8internal26fixed_address_empty_stringE
我该如何解决?
在 Raspberry 中我试过:ldd -d -r untitled
linux-vdso.so.1 (0x7ef7d000)
/usr/lib/arm-linux-gnueabihf/libarmmem.so (0x76ee8000)
libprotobuf.so.21 => /usr/local/lib/libprotobuf.so.21 (0x76c9d000)
libQt5Widgets.so.5 => /usr/local/qt5pi/lib/libQt5Widgets.so.5 (0x76770000)
libQt5Gui.so.5 => /usr/local/qt5pi/lib/libQt5Gui.so.5 (0x762b8000)
libQt5Mqtt.so.5 => /usr/local/qt5pi/lib/libQt5Mqtt.so.5 (0x76288000)
libQt5Network.so.5 => /usr/local/qt5pi/lib/libQt5Network.so.5 (0x7610b000)
libQt5Core.so.5 => /usr/local/qt5pi/lib/libQt5Core.so.5 (0x75ba1000)
libGLESv2.so.2 => /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2 (0x75b7c000)
libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x75b53000)
libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x75a0b000)
libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x7598c000)
libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x7595f000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x75820000)
libz.so.1 => /lib/arm-linux-gnueabihf/libz.so.1 (0x757f9000)
/lib/ld-linux-armhf.so.3 (0x76efe000)
libpng16.so.16 => /usr/lib/arm-linux-gnueabihf/libpng16.so.16 (0x757bf000)
libdouble-conversion.so.1 => /usr/lib/arm-linux-gnueabihf/libdouble-conversion.so.1 (0x7579d000)
libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0x7578a000)
libgthread-2.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgthread-2.0.so.0 (0x75778000)
libglib-2.0.so.0 => /lib/arm-linux-gnueabihf/libglib-2.0.so.0 (0x75670000)
libbrcmEGL.so => /opt/vc/lib/libbrcmEGL.so (0x75637000)
libbcm_host.so => /opt/vc/lib/libbcm_host.so (0x7560e000)
libvchiq_arm.so => /opt/vc/lib/libvchiq_arm.so (0x755f8000)
libvcos.so => /opt/vc/lib/libvcos.so (0x755df000)
librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0x755c8000)
libpcre.so.3 => /lib/arm-linux-gnueabihf/libpcre.so.3 (0x7554f000)
undefined symbol: _ZN6google8protobuf8internal26fixed_address_empty_stringE (./untitled)
undefined symbol: _ZNK6google8protobuf7Message25InitializationErrorStringEv (./untitled)
undefined symbol: _ZNK6google8protobuf7Message11GetTypeNameEv (./untitled)
undefined symbol: _ZN6google8protobuf8internal24InlineGreedyStringParserEPSsPKcPNS1_12ParseContextE (./untitled)
undefined symbol: _ZN6google8protobuf2io19EpsCopyOutputStream30WriteStringMaybeAliasedOutlineEjRKSsPh (./untitled)
最佳答案
尝试将其添加到您的 .pro 文件中。
DEFINES += PROTOBUF_USE_DLLS
实际上您正在链接到动态构建的 PB 库。因此,您需要添加此预处理器定义。如果可以的话,您也可以静态构建 PB。
您可能还想注意 this :
Note for cross-compiling
The makefiles normally invoke the protoc executable that they just built in order to build tests. When cross-compiling, the protoc executable may not be executable on the host machine. In this case, you must build a copy of protoc for the host machine first, then use the --with-protoc option to tell configure to use it instead. For example:
./configure --with-protoc=protoc
This will use the installed protoc (found in your $PATH) instead of trying to execute the one built during the build process. You can also use an executable that hasn't been installed. For example, if you built the protobuf package for your host machine in ../host, you might do:
./configure --with-protoc=../host/src/protoc
Either way, you must make sure that the protoc executable you use has the same version as the protobuf source code you are trying to use it with.
关于c++ - 交叉编译Qt to Raspberry Pi 3B+ addressbook (Protocol Buffer) - error symbol lookup error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58680056/
我在下面检查了链接和API,它们都已过期并且没有最新数据。 http://www.postalpincode.in/Api-Details https://pincode.net.in/194101
在 iOS10.0 中,从联系人选择器中选择联系人会导致应用程序崩溃。联系人选取器使用 ABPeoplePickerNavigationController 显示,如下所示: let contacts
我需要以编程方式备份具有所有记录(数字,名称,图像等)的所有联系人。我阅读了有关AddressBook.framework的信息,但是有一种简单的方法可以备份所有联系人吗? 最佳答案 1.一种方法
在我的 iOS 应用程序中,我创建了自己的联系表单,该表单附加了我的应用程序的唯一标识符。我想将地址簿中的联系人更新为 sql“更新”语句。 在 iOS 中我只看到 ABAddressBookAddR
AddressBook 存在一些我无法重现的问题,代码在我的 iPhone 和 iPad 上运行,这发生在客户端手机上并导致应用程序崩溃。据我从 Crashlytics 中看到的问题应该在以下行中:
我有 2 个类图,类地址 +forename +surename +street +houseno +code +state +toString 第二个地址簿 insert(address: Addr
我的 ABAddressBookGetPersonWithRecordID 和 ABPersonSetImageData 都出现了一些内存泄漏。在发帖之前我一直在寻找解决方案,但我仍然不明白。如果我用
我在 AddressBook 中创建了一个名为“Qref”的自定义属性。我可以使用 [ABPerson properties] 检查它是否存在,并且对于我编写的任何测试应用程序来说它始终存在。 顺便说
我正在阅读 how to work with the iOS AddressBook 上的文档.虽然到目前为止我了解它的一般机制,但我很难理解这个框架特别是如何构建背后的基本原理。我刚刚完成我的第二个
我试图找出 iPhone 地址簿中完整的“个人记录”默认具有哪些属性。 它必须隐藏在 API 的某处 https://developer.apple.com/library/content/docum
我编写了以下方法来准备联系人词典列表:名字、姓氏和电子邮件(如果不存在则忽略) ... // 'filter' is search String NSArray *lContacts =
我想在我的应用程序中添加一个 CNContactPickerViewController。 用户必须点击一个按钮,按钮才会打开,这样他就可以选择一个联系人。 如果用户选择了一个联系人,它的名字将被我的
我在我的 IOS 应用程序中使用 Addressbook 来获取联系人姓名和号码,但奇怪的是它显示了一些联系人的电话号码。 我希望它能显示所有联系人列表和电话号码。 下面是我获取电话号码的代码: -(
我使用以下代码来检索用户选择的人员的电子邮件地址 ABMultiValueRef emailMultiValue = ABRecordCopyValue(person, kABPersonEmailP
我有一个地址簿程序,[1] 添加条目 [2] 删除条目 [3] 更新/编辑条目 [4] 查看所有条目和 [5] 查看特定条目.. 条目存储在数组entry[]中,如下所示: entry[counter
我从 AddressBookUI 中选择名字和姓氏。我正在控制用户名是否存在于我的数组中并且我可以找到它。 我的问题是,我试图在用户点击(选择)后呈现并提醒 View ,但我遇到了这个问题,但是当我想
这是我遇到的问题。非常感谢任何帮助。 代码如下: var addressBook: ABAddressBookRef = { var error: Unmanaged? return
我正在为 iOS 开发并尝试在我的 iOS 项目中链接 AddressBook.framework。所有其他框架都可用并且可以毫无问题地链接。我正在使用 Xcode 6.1,我的开发目标是 OS X
如果想检查人员记录是否有电子邮件地址。所以: ABMultiValueRef emailMultiValue = ABRecordCopyValue(person, kABPersonEmailPro
我正在尝试引用当前地址簿如下: let addressBookRef: ABAddressBook = ABAddressBookCreateWithOptions(nil, nil).takeRet
我是一名优秀的程序员,十分优秀!