Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Static Build Using Plugins Problem

Static Build Using Plugins Problem

Scheduled Pinned Locked Moved Installation and Deployment
2 Posts 1 Posters 2.2k 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.
  • B Offline
    B Offline
    babazaroni
    wrote on last edited by
    #1

    Hello,

    I'm trying to build against a static qt build but get the error:

    main.obj:-1: error: LNK2019: unresolved external symbol "class QObject * __cdecl qt_plugin_instance_qjpeg(void)" (?qt_plugin_instance_qjpeg@@YAPAVQObject@@XZ) referenced in function "public: __thiscall StaticqjpegPluginInstance::StaticqjpegPluginInstance(void)" (??0StaticqjpegPluginInstance@@QAE@XZ)

    My .pro file has:

    @
    CONFIG += static
    static {
    DEFINES += STATIC_BUILD
    QTPLUGIN += qjpeg
    }
    @

    My main has:

    @
    #ifdef STATIC_BUILD
    #include <QtPlugin>
    Q_IMPORT_PLUGIN(qjpeg)
    #endif
    @

    qjpeg4.lib in plugins/imageformats is being linked against because if I change the name, I get a link error.

    Qt 4.8.0 was configured with: configure -static -shared -qt-libjpeg

    I'm using QtCreator and msvc2008.

    I see this problem mentioned a few times in the forum, but I've checked everything that I know of. Any Ideas?

    [EDIT: code formatting, please wrap in @-tags, Volker]

    1 Reply Last reply
    0
    • B Offline
      B Offline
      babazaroni
      wrote on last edited by
      #2

      I did a dumpbin /EXPORTS on qjpeg4.lib and the only symbols are:

      _qt_plugin_instance
      _qt_plugin_query_verification_data

      So, I don't see how the linker will find qt_plugin_instance_qjpeg.

      Any ideas?

      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