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. QImageIOPlugin doesn't work

QImageIOPlugin doesn't work

Scheduled Pinned Locked Moved Unsolved General and Desktop
15 Posts 4 Posters 866 Views
  • 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.
  • S Offline
    S Offline
    sandro4912
    wrote on last edited by sandro4912
    #6

    I get this error on startup:

    
    "The plugin 'E:/Qt/5.12.2/msvc2017/plugins/imageformats/textimage1.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" 
             not a plugin
    QFactoryLoader::QFactoryLoader() checking directory path "E:/Cpp_Projekte/QT/Foundations_of_QT/CH11_image_plugin/read/build-read-Desktop_Qt_5_12_2_MSVC2017_32bit-Debug/debug/imageformats" ...
    loaded library "E:/Qt/5.12.2/msvc2017/plugins/imageformats/qgifd.dll"
    loaded library "E:/Qt/5.12.2/msvc2017/plugins/imageformats/qicnsd.dll"
    loaded library "E:/Qt/5.12.2/msvc2017/plugins/imageformats/qicod.dll"
    loaded library "E:/Qt/5.12.2/msvc2017/plugins/imageformats/qjpegd.dll"
    loaded library "E:/Qt/5.12.2/msvc2017/plugins/imageformats/qsvgd.dll"
    loaded library "E:/Qt/5.12.2/msvc2017/plugins/imageformats/qtgad.dll"
    loaded library "E:/Qt/5.12.2/msvc2017/plugins/imageformats/qtiffd.dll"
    loaded library "E:/Qt/5.12.2/msvc2017/plugins/imageformats/qwbmpd.dll"
    loaded library "E:/Qt/5.12.2/msvc2017/plugins/imageformats/qwebpd.dll"
    

    I build the plugin and the project with MSVC2017 32 Bit Debug to get the Debug Output. There should not be a mix?

    The output of the plugin file looks like this:

    22:57:44: Running steps for project image_plugin...
    22:57:44: Configuration unchanged, skipping qmake step.
    22:57:44: Starting: "E:\Qt\Tools\QtCreator\bin\jom.exe" install
    	E:\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Release install
    	copy /y release\textimage1.dll E:\Qt\5.12.2\msvc2017\plugins\imageformats\textimage1.dll
            1 Datei(en) kopiert.
    22:57:44: The process "E:\Qt\Tools\QtCreator\bin\jom.exe" exited normally.
    22:57:44: Elapsed time: 00:00.
    
    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #7

      @sandro4912 said in QImageIOPlugin doesn't work:

      copy /y release\textimage1.dll E:\Qt\5.12.2\msvc2017\plugins\imageformats\textimage1.dll

      This does not look like a debug build.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

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

        Your plugin is named: textimage1.dll It is missing the d suffix for your debug build.

        You can use TARGET = $$qtLibraryTarget(textimage)

        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
        2
        • S Offline
          S Offline
          sandro4912
          wrote on last edited by
          #9

          Than i wonder why it is not build as debug.

          I clearly select debug and then build:

          0_1561275497852_958750a2-35c8-4131-bb00-c2b24a1eb0fb-image.png

          The build settings for debug:

          0_1561275704127_5d06df1a-fa93-4f74-b158-600fdf3aff97-image.png

          I already removed the release flag from CONFIG so it should not get forced into release or should it?

          TEMPLATE = lib
          CONFIG += plugin
          TARGET = $$qtLibraryTarget(textimage)
          VERSION = 1.0.0
          
          HEADERS += \
              textimagehandler.h \
              textimageplugin.h
          
          SOURCES += \
              textimagehandler.cpp \
              textimageplugin.cpp
          
          target.path += $$[QT_INSTALL_PLUGINS]/imageformats
          INSTALLS += target
          
          DISTFILES += \
              textimageplugin.json
          

          What does TARGET = $$qtLibraryTarget(textimage) do? why is it needed?

          aha_1980A 1 Reply Last reply
          0
          • S sandro4912

            Than i wonder why it is not build as debug.

            I clearly select debug and then build:

            0_1561275497852_958750a2-35c8-4131-bb00-c2b24a1eb0fb-image.png

            The build settings for debug:

            0_1561275704127_5d06df1a-fa93-4f74-b158-600fdf3aff97-image.png

            I already removed the release flag from CONFIG so it should not get forced into release or should it?

            TEMPLATE = lib
            CONFIG += plugin
            TARGET = $$qtLibraryTarget(textimage)
            VERSION = 1.0.0
            
            HEADERS += \
                textimagehandler.h \
                textimageplugin.h
            
            SOURCES += \
                textimagehandler.cpp \
                textimageplugin.cpp
            
            target.path += $$[QT_INSTALL_PLUGINS]/imageformats
            INSTALLS += target
            
            DISTFILES += \
                textimageplugin.json
            

            What does TARGET = $$qtLibraryTarget(textimage) do? why is it needed?

            aha_1980A Offline
            aha_1980A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on last edited by
            #10

            @sandro4912

            Your plugin is named: textimage1.dll It is missing the d suffix for your debug build.

            On Windows, the library must be called textimage1d.dll if it is a debug version. The reason was already explained above: On Windows, you cannot mix debug and release objects.

            Qt has to stay free or it will die.

            1 Reply Last reply
            2
            • S Offline
              S Offline
              sandro4912
              wrote on last edited by
              #11

              Ok but were do i change the name with the d suffix? In the pro file? Or can i just rename it manually?

              1 Reply Last reply
              0
              • Christian EhrlicherC Offline
                Christian EhrlicherC Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by
                #12

                @sandro4912 said in QImageIOPlugin doesn't work:

                Ok but were do i change the name with the d suffix? In the pro file? Or can i just rename it manually?

                Simply read @SGaist 's answer: 'You can use TARGET = $$qtLibraryTarget(textimage)'

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                1 Reply Last reply
                2
                • S Offline
                  S Offline
                  sandro4912
                  wrote on last edited by
                  #13

                  I added the target but it doesn't seem to add the d suffix to make it debug:

                  TEMPLATE = lib
                  CONFIG += plugin
                  VERSION = 1.0.0
                  
                  HEADERS += \
                      textimagehandler.h \
                      textimageplugin.h
                  
                  SOURCES += \
                      textimagehandler.cpp \
                      textimageplugin.cpp
                  
                  TARGET = $$qtLibraryTarget(textimage)
                  target.path += $$[QT_INSTALL_PLUGINS]/imageformats
                  INSTALLS += target
                  
                  DISTFILES += \
                      textimageplugin.json
                  
                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #14

                    Did you re-run qmake after changing the TARGET value ?

                    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
                    • S Offline
                      S Offline
                      sandro4912
                      wrote on last edited by sandro4912
                      #15

                      Ok i guess i forgot to rerun it. Now i could generate the debug files.

                      When running my testprogram with debug it stills fails but the message is different

                      Got keys from plugin meta data ()
                      QFactoryLoader::QFactoryLoader() checking directory path "E:/Cpp_Projekte/QT/Foundations_of_QT/CH11_image_plugin/read/build-read-Desktop_Qt_5_12_2_MSVC2017_32bit-Debug/debug/imageformats" ...
                      loaded library "E:/Qt/5.12.2/msvc2017/plugins/imageformats/qgifd.dll"
                      loaded library "E:/Qt/5.12.2/msvc2017/plugins/imageformats/qicnsd.dll"
                      loaded library "E:/Qt/5.12.2/msvc2017/plugins/imageformats/qicod.dll"
                      loaded library "E:/Qt/5.12.2/msvc2017/plugins/imageformats/qjpegd.dll"
                      loaded library "E:/Qt/5.12.2/msvc2017/plugins/imageformats/qsvgd.dll"
                      loaded library "E:/Qt/5.12.2/msvc2017/plugins/imageformats/qtgad.dll"
                      loaded library "E:/Qt/5.12.2/msvc2017/plugins/imageformats/qtiffd.dll"
                      loaded library "E:/Qt/5.12.2/msvc2017/plugins/imageformats/qwbmpd.dll"
                      loaded library "E:/Qt/5.12.2/msvc2017/plugins/imageformats/qwebpd.dll"
                      "bmp"
                      "cur"
                      "gif"
                      "icns"
                      "ico"
                      "jpeg"
                      "jpg"
                      "pbm"
                      "pgm"
                      "png"
                      "ppm"
                      "svg"
                      "svgz"
                      "tga"
                      "tif"
                      "tiff"
                      "wbmp"
                      "webp"
                      "xbm"
                      "xpm"
                      Failed to load.
                      QLibraryPrivate::unload succeeded on "E:/Qt/5.12.2/msvc2017/plugins/styles/qwindowsvistastyled.dll" 
                      QLibraryPrivate::unload succeeded on "E:/Qt/5.12.2/msvc2017/plugins/imageformats/qgifd.dll" 
                      QLibraryPrivate::unload succeeded on "E:/Qt/5.12.2/msvc2017/plugins/imageformats/qicnsd.dll" 
                      QLibraryPrivate::unload succeeded on "E:/Qt/5.12.2/msvc2017/plugins/imageformats/qicod.dll" 
                      QLibraryPrivate::unload succeeded on "E:/Qt/5.12.2/msvc2017/plugins/imageformats/qjpegd.dll" 
                      QLibraryPrivate::unload succeeded on "E:/Qt/5.12.2/msvc2017/plugins/imageformats/qsvgd.dll" 
                      QLibraryPrivate::unload succeeded on "E:/Qt/5.12.2/msvc2017/plugins/imageformats/qtgad.dll" 
                      QLibraryPrivate::unload succeeded on "E:/Qt/5.12.2/msvc2017/plugins/imageformats/qtiffd.dll" 
                      QLibraryPrivate::unload succeeded on "E:/Qt/5.12.2/msvc2017/plugins/imageformats/qwbmpd.dll" 
                      QLibraryPrivate::unload succeeded on "E:/Qt/5.12.2/msvc2017/plugins/imageformats/qwebpd.dll" 
                      QLibraryPrivate::unload succeeded on "E:/Qt/5.12.2/msvc2017/plugins/platforms/qwindowsd.dll"
                      

                      let me know if you need more information...

                      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