Qt 5.1 static with mingw-builds: undefined references to 'qt_cpu_features', 'qDetectCpuFeatures()' and 'qDecodeDataUrl(QUrl const&, QString&, QByteArr



  • I have built a static version of Qt 5.1 for Windows using mingw-builds. I use the following when linking to my application:

    -lQt5Core
    -lQt5Gui
    -lQt5Widgets
    -lQt5PrintSupport
    -lQt5PlatformSupport
    -lqtmain
    -lqwindows
    -lwindowsprintersupport
    -lz
    -lole32
    -lws2_32
    -luuid

    On my main file, I have this:

    Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
    Q_IMPORT_PLUGIN(QWindowsPrinterSupportPlugin)

    But when I build the application, I get the following errors:

    Qt/lib/win32/libQt5Gui.a(qtextdocument.o):qtextdocument.cpp:(.text+0xa3b2): undefined reference to qDecodeDataUrl(QUrl const&, QString&, QByteArray&)' Qt/lib/win32/libQt5Gui.a(qimage.o):qimage.cpp:(.text+0x17a4): undefined reference toqt_cpu_features'
    Qt/lib/win32/libQt5Gui.a(qimage.o):qimage.cpp:(.text+0x181b): undefined reference to qDetectCpuFeatures()' Qt/lib/win32/libQt5Gui.a(qimage.o):qimage.cpp:(.text+0x1820): undefined reference toqt_cpu_features'
    Qt/lib/win32/libQt5Gui.a(qimage.o):qimage.cpp:(.text+0x1827): undefined reference to qDetectCpuFeatures()' Qt/lib/win32/libQt5Gui.a(qimage.o):qimage.cpp:(.text+0x182c): undefined reference toqt_cpu_features'
    Qt/lib/win32/libQt5Gui.a(qimage.o):qimage.cpp:(.text+0x1833): undefined reference to qDetectCpuFeatures()' Qt/lib/win32/libQt5Gui.a(qimage.o):qimage.cpp:(.text+0x1838): undefined reference toqt_cpu_features'
    c:/program files/mingw-builds/x32-4.8.1-posix-dwarf-rev2/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.8.1/../../../../i686-w64-mingw32/bin/ld.exe: Qt/lib/win32/lib
    Qt5Gui.a(qimage.o): bad reloc address 0xd4 in section `.data'

    Which additional libraries do I need to link to in order to resolve this?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.