Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

VS2017 Static linking QGif Plugin



  • I'm working with 5.12.1 static build. Tried to use QMovie to display an animated gif on dialog, but it returned error "Unsupported Image Format", looks like I need to link with qgif.lib.

    1. Added Q_IMPORT_PLUGIN(qgif) to the main.cpp
    2. Added QT_STATICPLUGIN in preprocessor
    3. Added qgif.lib to VS Project Properties: Configuration -> Linker -> Additional Dependencies

    I'm getting following error:

    Error LNK2019	unresolved external symbol "struct QStaticPlugin const __cdecl qt_static_plugin_qgif(void)" (?qt_static_plugin_qgif@@YA?BUQStaticPlugin@@XZ) referenced in function "public: __thiscall StaticqgifPluginInstance::StaticqgifPluginInstance(void)" (??0StaticqgifPluginInstance@@QAE@XZ)
    


  • @Taytoo Resolved Windows vista style issue by adding "Plugin" at the end.

    Q_IMPORT_PLUGIN(QWindowsVistaStylePlugin)

    and also adding uxtheme.lib to linker dependencies.

    Resolved qgif plugin by using

    Q_IMPORT_PLUGIN(QGifPlugin)

    and adding qgif.lib to linker dependencies.



  • @Taytoo I've also been having issues with Windows UI on Win7 looking like Windows Classic and it looks like I need to import windows vista style library for that, which brings me back to this issue.

    Tried:

    1. Q_IMPORT_PLUGIN(qwindowsvistastyle)
    2. Added qwindowsvistastyle.lib and qwindows.lib to Linker Additional Dependencies.

    Getting a similiar error as previous one:

    Error	LNK2019	unresolved external symbol "struct QStaticPlugin const __cdecl qt_static_plugin_qwindowsvistastyle(void)" (?qt_static_plugin_qwindowsvistastyle@@YA?BUQStaticPlugin@@XZ) referenced in function "void __cdecl `dynamic initializer for 'staticqwindowsvistastyleInstance''(void)" (??__EstaticqwindowsvistastyleInstance@@YAXXZ)	
    

    Can anyone please help me out, this is a blocking issue for me.



  • @Taytoo Resolved Windows vista style issue by adding "Plugin" at the end.

    Q_IMPORT_PLUGIN(QWindowsVistaStylePlugin)

    and also adding uxtheme.lib to linker dependencies.

    Resolved qgif plugin by using

    Q_IMPORT_PLUGIN(QGifPlugin)

    and adding qgif.lib to linker dependencies.


Log in to reply