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. Visual Studio 2017 unresolved external symbol struct QStaticPlugin
Forum Updated to NodeBB v4.3 + New Features

Visual Studio 2017 unresolved external symbol struct QStaticPlugin

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

    I'm attempting to build a project that relies on Qt. I'm most of the way there and have one last unresolved symbol related to Qt plugins, error message below.

    I'm using qt-everywhere-opensource-src-5.9.1.zip and as I need to build x86 I'm linking against the .lib files in the msvc2015\lib directory. I've added qtmain.lib, Qt5Core.lib, Qt5Widgets.lib, Qt5Gui.lib and Qt5Network.lib. Search results I need to also link against Qt5PlatformSupport.lib and/or qwindows.lib but neither of those libraries are available. Is there a different mechanism required to link for a Qt static plugin? Note I'm still trying to build so I haven't hit the more common problem of not being able to locate the plugin dll's.

    Severity Code Description Project File Line Suppression State
    Error LNK2001 unresolved external symbol "struct QStaticPlugin const __cdecl qt_static_plugin_QWindowsIntegrationPlugin(void)" (?qt_static_plugin_QWindowsIntegrationPlugin@@YA?BUQStaticPlugin@@XZ) bitcoin-qt F:\Dev\github\sipsorcery_bitcoin\contrib\msvc\bitcoin-qt\bitcoin.obj 1

    kshegunovK 1 Reply Last reply
    0
    • A azaclauson

      I'm attempting to build a project that relies on Qt. I'm most of the way there and have one last unresolved symbol related to Qt plugins, error message below.

      I'm using qt-everywhere-opensource-src-5.9.1.zip and as I need to build x86 I'm linking against the .lib files in the msvc2015\lib directory. I've added qtmain.lib, Qt5Core.lib, Qt5Widgets.lib, Qt5Gui.lib and Qt5Network.lib. Search results I need to also link against Qt5PlatformSupport.lib and/or qwindows.lib but neither of those libraries are available. Is there a different mechanism required to link for a Qt static plugin? Note I'm still trying to build so I haven't hit the more common problem of not being able to locate the plugin dll's.

      Severity Code Description Project File Line Suppression State
      Error LNK2001 unresolved external symbol "struct QStaticPlugin const __cdecl qt_static_plugin_QWindowsIntegrationPlugin(void)" (?qt_static_plugin_QWindowsIntegrationPlugin@@YA?BUQStaticPlugin@@XZ) bitcoin-qt F:\Dev\github\sipsorcery_bitcoin\contrib\msvc\bitcoin-qt\bitcoin.obj 1

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by kshegunov
      #2

      @azaclauson said in Visual Studio 2017 unresolved external symbol struct QStaticPlugin:

      Is there a different mechanism required to link for a Qt static plugin?

      Not for linking, no. You should be able to find those libraries in the plugins directory of your build (I think they were in <QtDir>plugins/platforms). You also might need to initialize each of the plugins manually in code as you're linking static:

      #include <QtPlugin>
      
      Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
      Q_IMPORT_PLUGIN(qjpeg)
      // ... etc.
      

      More info here.

      Read and abide by the Qt Code of Conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        azaclauson
        wrote on last edited by
        #3

        Not for linking, no. You should be able to find those libraries in the plugins directory of your build (I think they were in <QtDir>plugins/platforms). You also might need to initialize each of the plugins manually in code as you're linking static:

        If I've understood correctly the default Qt downloads available at https://www1.qt.io/download-open-source/#section-2 are built with shared rather than static plugins. In order to get Qt with static plugins I need to do a custom build with the "-static" parameter specified for configure.bat?

        That leaves me in a chicken and egg situation. I've been unable to get very far with building Qt either from the git repo or from the above download (if anyone has a configure command that works with the Visual Studio 2017 command prompt I'd be very grateful). I can't make changes to the consumer project I'm attempting to build so need to stick with static plugins.

        kshegunovK 1 Reply Last reply
        0
        • A azaclauson

          Not for linking, no. You should be able to find those libraries in the plugins directory of your build (I think they were in <QtDir>plugins/platforms). You also might need to initialize each of the plugins manually in code as you're linking static:

          If I've understood correctly the default Qt downloads available at https://www1.qt.io/download-open-source/#section-2 are built with shared rather than static plugins. In order to get Qt with static plugins I need to do a custom build with the "-static" parameter specified for configure.bat?

          That leaves me in a chicken and egg situation. I've been unable to get very far with building Qt either from the git repo or from the above download (if anyone has a configure command that works with the Visual Studio 2017 command prompt I'd be very grateful). I can't make changes to the consumer project I'm attempting to build so need to stick with static plugins.

          kshegunovK Offline
          kshegunovK Offline
          kshegunov
          Moderators
          wrote on last edited by
          #4

          @azaclauson said in Visual Studio 2017 unresolved external symbol struct QStaticPlugin:

          If I've understood correctly the default Qt downloads available at https://www1.qt.io/download-open-source/#section-2 are built with shared rather than static plugins.

          I believe so.

          In order to get Qt with static plugins I need to do a custom build with the "-static" parameter specified for configure.bat?

          That'd be implied if the installer provides only a shared library build.

          I've been unable to get very far with building Qt either from the git repo or from the above download (if anyone has a configure command that works with the Visual Studio 2017 command prompt I'd be very grateful).

          I suggest you open a new topic for that specifically and provide the configure command you had tried, what was the output and what didn't work.

          Read and abide by the Qt Code of Conduct

          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