Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Link problem - imageformats plugins not found
Forum Updated to NodeBB v4.3 + New Features

Link problem - imageformats plugins not found

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rivka
    wrote on last edited by
    #1

    Hello,

    I have received an application code that was written in 2010 on QT 4.6.2.
    I am new to Qt and have downloaded Qt 5.7 from Qt site.

    When linking the application, I get a failure, the first 3 messages are:

    ./debug\main.o: In function ZN25StaticqjpegPluginInstanceC1Ev': C:\RDF\build-RDF-Desktop_Qt_5_7_0_MinGW_32bit-Debug/../RDF/main.cpp:34: undefined reference to qt_static_plugin_qjpeg()'
    ./debug\main.o: In function ZN24StaticqgifPluginInstanceC1Ev': C:\RDF\build-RDF-Desktop_Qt_5_7_0_MinGW_32bit-Debug/../RDF/main.cpp:35: undefined reference to qt_static_plugin_qgif()'
    ./debug\main.o: In function ZN29StaticqkrcodecsPluginInstanceC1Ev': C:\RDF\build-RDF-Desktop_Qt_5_7_0_MinGW_32bit-Debug/../RDF/main.cpp:36: undefined reference to qt_static_plugin_qkrcodecs()'

    I understand that the linker could not find the plugins: qjpeg, qgif, qkrcodecs.

    In the .pro file, the instructions are:


    TEMPLATE = app
    QT += svg
    TARGET = RDF

    SOURCES += main.cpp
    mainwindow.cpp
    ....
    simulprogressdialog.cpp

    HEADERS += mainwindow.h
    ....
    simulprogressdialog.h

    CONFIG += static

    FORMS += mainwindow.ui
    savedialog.ui

    RESOURCES += application.qrc

    RC_FILE = logo.rc

    INCLUDEPATH =
    .
    ./../../Qwt-6.1.3/src
    C:\Qt\5.7\mingw53_32\include\QtWidgets
    C:\Qt\5.7\mingw53_32\include\QtPrintSupport

    LIBS += -LC:/Qwt-6.1.3/lib -lqwt
    -LC:\RDF\RDF\gsl\lib -lgsl -lgslcblas
    -LC:\Qt\5.7\mingw53_32\plugins\imageformats

    QTPLUGIN += qjpeg
    qgif
    qkrcodecs


    The main.cpp file has the lines:

    Q_IMPORT_PLUGIN(qjpeg)
    Q_IMPORT_PLUGIN(qgif)
    Q_IMPORT_PLUGIN(qkrcodecs)

    I opened the generated MakeFile.Debug file and found that the LIBS directive
    is as follows (I have split it into few lines):

    LIBS =
    -lmingw32
    -LC:\Qt\5.7\mingw53_32\lib
    C:\Qt\5.7\mingw53_32\lib\libqtmaind.a
    -LC:\utils\postgresql\pgsql\lib
    -LC:\utils\my_sql\my_sql\lib
    -lshell32
    -LC:\Qwt-6.1.3\lib -lqwt
    -LC:\RDF\RDF\gsl\lib -lgsl -lgslcblas
    -LC:\Qt\5.7\mingw53_32\plugins\imageformats
    C:\Qt\5.7\mingw53_32\lib\libQt5Svgd.a
    C:\Qt\5.7\mingw53_32\lib\libQt5Widgetsd.a
    C:\Qt\5.7\mingw53_32\lib\libQt5Guid.a
    C:\Qt\5.7\mingw53_32\lib\libQt5Cored.a
    debug\logo_res.o

    I see that the generated Makefile took the path to the Qwt & GSL libraries, it also
    took the path to the plugins directory, BUT it did not take the QTPLUGIN directive
    from the .pro file and hence did not find the plugins.

    I also see two lines starting with "-LC:\utils..." which point to a directory
    that does not exists on my computer. I do not know where those lines came from.

    I do not understand what is wrong in the .pro file or in my environment, and why
    the link process does not find the plugins.
    Any help will be very appreciated.
    Rivka

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      The .pro file is written to be used with a static Qt version. Remove the Q_IMPORT_PLUGIN statements and the QTPLUGIN and you should be able to go further.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • R Offline
        R Offline
        Rivka
        wrote on last edited by
        #3

        Thank you, that did solve the link problem.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved