user2684657
user2684657

Reputation: 23

Qt5 undefined reference to `QString

I have a sensor that in their SDK, they are calling QT5 package.

This is the GCC command to build the programgcc Main.c -o main -L../../Release -L/usr/lib/arm-linux-gnueabihf -lQt5SerialPort -lLeddarC -lLeddar -lLeddarTech -lstdc++

But after that I'm getting these errors:

../../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'

I think Qstring is a part of QtCore, I tired to find it to add to gcc but I just find /usr/lib/arm-linux-gnueabihf/libQtCore.so.4 that is basically based on Qt4 and not 5.

I aleady found the location of Qt5SerialPort at /usr/lib/arm-linux-gnueabihf .But I don't know why I'm getting error for QString Could you please help me with solving this issue?

When I look for QString I got this:

/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

It seems that They are in include folder but I don't know how I can call them with GCC since they are not build *.so libraries.

Upvotes: 2

Views: 3873

Answers (1)

stanislav888
stanislav888

Reputation: 414

Think you need add new -lQtCore option to gcc command.

Upvotes: 1

Related Questions