Qt 5.9 cross compilation for iMX6 - build error on make



  • For QT 5.9.5 version, after many difficulties, finally i was able to successfully do the configure and generate a Makefile.
    While executing make, I get the below error:

    .obj/qnetworkcookie.o: In function QNetworkCookiePrivate::parseSetCookieHeaderLine(QByteArray const&)': qnetworkcookie.cpp:(.text+0x2f04): undefined reference toQDateTime::QDateTime(QDateTime&&)'
    qnetworkcookie.cpp:(.text+0x3948): undefined reference to QDateTime::fromSecsSinceEpoch(long long, Qt::TimeSpec, int)' .obj/qnetworkcookiejar.o: In functionQNetworkCookieJar::validateCookie(QNetworkCookie const&, QUrl const&) const':
    qnetworkcookiejar.cpp:(.text+0x2ac): undefined reference to qIsEffectiveTLD(QStringRef const&)' .obj/qabstractnetworkcache.o: In functionQDataStream& QtPrivate::readArrayBasedContainer<QList<QPair<QByteArray, QByteArray> > >(QDataStream&, QList<QPair<QByteArray, QByteArray> >&)':
    qabstractnetworkcache.cpp:(.text.ZN9QtPrivate23readArrayBasedContainerI5QListI5QPairI10QByteArrayS3_EEEER11QDataStreamS7_RT[ZN9QtPrivate23readArrayBasedContainerI5QListI5QPairI10QByteArrayS3_EEEER11QDataStreamS7_RT]+0x2c): undefined reference to QIODevice::isTransactionStarted() const' .obj/qftp.o: In functionQFtpDTP::parseDir(QByteArray const&, QString const&, QUrlInfo*) [clone .part.23]':
    qftp.cpp:(.text+0x2ab0): undefined reference to QString::resize(int, QChar)' .obj/qftp.o: In functionQFtpPI::readyRead() [clone .part.49]':
    qftp.cpp:(.text+0x85c0): undefined reference to QString::resize(int, QChar)' qftp.cpp:(.text+0x85dc): undefined reference toQString::resize(int, QChar)'
    qftp.cpp:(.text+0x85f8): undefined reference to QString::resize(int, QChar)' qftp.cpp:(.text+0x8614): undefined reference toQString::resize(int, QChar)'
    .obj/qftp.o:qftp.cpp:(.text+0x8630): more undefined references to QString::resize(int, QChar)' follow .obj/qnetworkreplyhttpimpl.o: In functionQNetworkReplyHttpImplPrivate::loadFromCacheIfAllowed(QHttpNetworkRequest&)':
    qnetworkreplyhttpimpl.cpp:(.text+0x6d48): undefined reference to QDateTime::toSecsSinceEpoch() const' qnetworkreplyhttpimpl.cpp:(.text+0x6d54): undefined reference toQDateTime::toSecsSinceEpoch() const'
    .obj/qauthenticator.o: In function QAuthenticatorPrivate::calculateResponse(QByteArray const&, QByteArray const&)': qauthenticator.cpp:(.text+0x6cdc): undefined reference toQDateTime::currentSecsSinceEpoch()'
    .obj/qabstractsocket.o: In function QAbstractSocketPrivate::flush()': qabstractsocket.cpp:(.text+0xac): undefined reference toQIODevicePrivate::allWriteBuffersEmpty() const'
    .obj/qabstractsocket.o: In function QAbstractSocket::disconnectFromHost()': qabstractsocket.cpp:(.text+0xa24): undefined reference toQIODevicePrivate::setWriteChannelCount(int)'
    qabstractsocket.cpp:(.text+0xaa8): undefined reference to QIODevicePrivate::setWriteChannelCount(int)' qabstractsocket.cpp:(.text+0xac8): undefined reference toQIODevicePrivate::allWriteBuffersEmpty() const'
    .obj/qabstractsocket.o: In function QAbstractSocket::setSocketDescriptor(int, QAbstractSocket::SocketState, QFlags<QIODevice::OpenModeFlag>)': qabstractsocket.cpp:(.text+0xb60): undefined reference toQIODevicePrivate::setReadChannelCount(int)'
    qabstractsocket.cpp:(.text+0xb6c): undefined reference to QIODevicePrivate::setWriteChannelCount(int)' qabstractsocket.cpp:(.text+0xd70): undefined reference toQIODevicePrivate::setWriteChannelCount(int)'
    qabstractsocket.cpp:(.text+0xe18): undefined reference to QIODevicePrivate::setReadChannelCount(int)' qabstractsocket.cpp:(.text+0xe28): undefined reference toQIODevicePrivate::setWriteChannelCount(int)'
    qabstractsocket.cpp:(.text+0xe40): undefined reference to QIODevicePrivate::setReadChannelCount(int)' .obj/qabstractsocket.o: In functionQAbstractSocketPrivate::emitReadyRead(int)':
    qabstractsocket.cpp:(.text+0x1124): undefined reference to QIODevice::channelReadyRead(int)' qabstractsocket.cpp:(.text+0x1150): undefined reference toQIODevice::channelReadyRead(int)'
    .obj/qabstractsocket.o: In function QAbstractSocketPrivate::emitBytesWritten(long long, int)': qabstractsocket.cpp:(.text+0x147c): undefined reference toQIODevice::channelBytesWritten(int, long long)'
    .obj/qabstractsocket.o: In function QAbstractSocket::writeData(char const*, long long)': qabstractsocket.cpp:(.text+0x1548): undefined reference toQRingBuffer::append(char const*, long long)'
    qabstractsocket.cpp:(.text+0x15e4): undefined reference to QRingBuffer::append(char const*, long long)' .obj/qabstractsocket.o: In functionQAbstractSocketPrivate::fetchConnectionParameters()':
    qabstractsocket.cpp:(.text+0x1914): undefined reference to QIODevicePrivate::setReadChannelCount(int)' qabstractsocket.cpp:(.text+0x1944): undefined reference toQIODevicePrivate::setWriteChannelCount(int)'
    qabstractsocket.cpp:(.text+0x1954): undefined reference to QIODevicePrivate::setReadChannelCount(int)' qabstractsocket.cpp:(.text+0x196c): undefined reference toQIODevicePrivate::setWriteChannelCount(int)'
    .obj/qabstractsocket.o: In function QAbstractSocket::abort()': qabstractsocket.cpp:(.text+0x1cd4): undefined reference toQIODevicePrivate::setWriteChannelCount(int)'
    .obj/qabstractsocket.o: In function QAbstractSocket::connectToHost(QString const&, unsigned short, QFlags<QIODevice::OpenModeFlag>, QAbstractSocket::NetworkLayerProtocol)': qabstractsocket.cpp:(.text+0x4988): undefined reference toQIODevicePrivate::setReadChannelCount(int)'
    qabstractsocket.cpp:(.text+0x4994): undefined reference to QIODevicePrivate::setWriteChannelCount(int)' .obj/qnativesocketengine_unix.o: In functionQNativeSocketEnginePrivate::nativeSelect(int, bool, bool, bool*, bool*) const':
    qnativesocketengine_unix.cpp:(.text+0x1f3c): undefined reference to qt_safe_poll(pollfd*, unsigned long, timespec const*)' .obj/qlocalsocket_unix.o: In functionQLocalSocket::waitForConnected(int)':
    qlocalsocket_unix.cpp:(.text+0x1cc4): undefined reference to qt_safe_poll(pollfd*, unsigned long, timespec const*)' .obj/qlocalserver_unix.o: In functionQLocalServerPrivate::waitForNewConnection(int, bool*)':
    qlocalserver_unix.cpp:(.text+0x958): undefined reference to qt_safe_poll(pollfd*, unsigned long, timespec const*)' .obj/qsslsocket.o: In functionQSslSocket::writeData(char const*, long long)':
    qsslsocket.cpp:(.text+0x384): undefined reference to QRingBuffer::append(char const*, long long)' .obj/qsslsocket.o: In functionQSslSocketPrivate::_q_connectedSlot()':
    qsslsocket.cpp:(.text+0x2324): undefined reference to QIODevice::readChannelCount() const' qsslsocket.cpp:(.text+0x2330): undefined reference toQIODevice::writeChannelCount() const'
    .obj/qsslsocket.o: In function QSslSocketPrivate::_q_channelReadyReadSlot(int)': qsslsocket.cpp:(.text+0x25e0): undefined reference toQIODevice::channelReadyRead(int)'
    .obj/qsslsocket.o: In function QSslSocketPrivate::_q_channelBytesWrittenSlot(int, long long)': qsslsocket.cpp:(.text+0x2654): undefined reference toQIODevice::channelBytesWritten(int, long long)'
    .obj/qsslsocket.o: In function QSslSocket::setSocketDescriptor(int, QAbstractSocket::SocketState, QFlags<QIODevice::OpenModeFlag>)': qsslsocket.cpp:(.text+0x4fd4): undefined reference toQIODevice::readChannelCount() const'
    qsslsocket.cpp:(.text+0x4fe0): undefined reference to QIODevice::writeChannelCount() const' .obj/qsslsocket.o: In functionQSslSocket::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)':
    qsslsocket.cpp:(.text+0x854c): undefined reference to QIODevice::channelBytesWritten(int, long long)' qsslsocket.cpp:(.text+0x8584): undefined reference toQIODevice::channelReadyRead(int)'
    .obj/qsslsocket_openssl.o: In function QSslSocketBackendPrivate::transmit()': qsslsocket_openssl.cpp:(.text+0x5150): undefined reference toQIODevice::channelBytesWritten(int, long long)'
    qsslsocket_openssl.cpp:(.text+0x527c): undefined reference to QRingBuffer::append(char const*, long long)' qsslsocket_openssl.cpp:(.text+0x529c): undefined reference toQIODevice::channelReadyRead(int)'
    .obj/qsslsocket_openssl_symbols.o: In function q_getTimeFromASN1(asn1_string_st const*)': qsslsocket_openssl_symbols.cpp:(.text+0x2fc8): undefined reference toQDateTime::QDateTime(QDateTime&&)'
    collect2: error: ld returned 1 exit status
    Makefile:586: recipe for target '../../lib/libQt5Network.so.5.9.5' failed
    make[3]: *** [../../lib/libQt5Network.so.5.9.5] Error 1
    make[3]: Leaving directory '/home/viu1cob/samba/workspace/source/qt-everywhere-opensource-src-5.9.5/qtbase/src/network'
    Makefile:274: recipe for target 'sub-network-make_first' failed
    make[2]: *** [sub-network-make_first] Error 2
    make[2]: Leaving directory '/home/viu1cob/samba/workspace/source/qt-everywhere-opensource-src-5.9.5/qtbase/src'
    Makefile:48: recipe for target 'sub-src-make_first' failed
    make[1]: *** [sub-src-make_first] Error 2
    make[1]: Leaving directory '/home/viu1cob/samba/workspace/source/qt-everywhere-opensource-src-5.9.5/qtbase'
    Makefile:82: recipe for target 'module-qtbase-make_first' failed
    make: *** [module-qtbase-make_first] Error 2

    I see some similar bugs reported in Qtbug and remains unresolved yet. Any ideas to resolve this will help.



  • the same problem on qt 5.12, and yet i have not find a way to solve it.
    Now i am searching how to fix it.
    If somebody have any suggestion´╝îplease comment here.



  • @MrYang

    Hi and welcome to devnet forum

    When find or file a bug report, please make sure to post a link here.
    This allows others to vote through the link increasing the chances that the bugs are treated and solved.


Log in to reply