【发布时间】:2017-11-21 23:26:41
【问题描述】:
我在他们的 SDK 中有一个传感器,他们正在调用 QT5 包。
这是构建程序的GCC命令gcc Main.c -o main -L../../Release -L/usr/lib/arm-linux-gnueabihf -lQt5SerialPort -lLeddarC -lLeddar -lLeddarTech -lstdc++
但在那之后我收到了这些错误:
../../Release/libLeddar.so: undefined reference to `QString::toLocal8Bit_helper(QChar const*, int)'
../../Release/libLeddarC.so: undefined reference to `QString::toUtf8_helper(QString const&)'
../../Release/libLeddarC.so: undefined reference to `__cxa_throw_bad_array_new_length@CXXABI_1.3.8'
我认为 Qstring 是 QtCore 的一部分,我厌倦了将其添加到 gcc 但我只是找到了基本上基于 Qt4 而不是 5 的 /usr/lib/arm-linux-gnueabihf/libQtCore.so.4。
我已经在/usr/lib/arm-linux-gnueabihf 找到了Qt5SerialPort 的位置。但我不知道为什么我收到QString 的错误
你能帮我解决这个问题吗?
当我寻找 QString 时,我得到了这个:
/usr/include/qt5/QtCore/QStringRef
/usr/include/qt5/QtCore/QStringData
/usr/include/qt5/QtCore/QStringBuilder
/usr/include/qt5/QtCore/QStringMatcher
/usr/include/qt5/QtCore/QStringList
/usr/include/qt5/QtCore/QStringListModel
/usr/include/qt5/QtCore/QStringDataPtr
/usr/include/qt5/QtCore/QString
/usr/include/qt5/QtCore/QStringListIterator
它们似乎在包含文件夹中,但我不知道如何使用 GCC 调用它们,因为它们不是构建 *.so 库。
【问题讨论】: