Uploaded image for project: 'Qt Visual Studio Tools'
  1. Qt Visual Studio Tools
  2. QTVSADDINBUG-391

Improve compatibility with static Qt builds

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 2.4.1
    • 1.2.4, 2.4.0
    • General
    • None
    • Windows 7 x64
      Visual Studio 2013 Ultimate Update 4
      Qt5 Visual Studio Add-in 1.2.4
    • Windows

    Description

      When you select a static build of Qt in Visual Studio, your project will not compile anymore. The reason is that you need those additional dependencies:

      Ws2_32.lib
      opengl32.lib
      qtharfbuzzng.lib
      

      If you do not add those libraries, you will receive linker error messages like "unresolved external symbol in Qt5Gui.lib(qharfbuzzng.obj)" and so on. This is surprising, because a shared library build of Qt works just fine without those dependencies.

      If you then finally found all the additional dependencies and compiled your project successfully, the executable will show the following error message on startup:

      This application failed to start because it could not find or load the Qt platform plugin "windows".

      To fix this, you have to add the following dependencies:

      imm32.lib
      winmm.lib
      Qt5PlatformSupport.lib
      qwindows.lib
      

      ...and the following to your additional library directories:

      $(QTDIR)\plugins\platforms

      ...and the following to your source code:

      #include <QtPlugin>
      Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)

      However, these steps are documented nowhere and not always obvious.

      It would be great if the Qt Visual Studio Add-in was able to deal with static builds of Qt properly. E.g. add the missing dependencies automatically if a static build is detected or provide some usage information on how to get a static build working.

      There is a similar bug report (https://bugreports.qt-project.org/browse/QTBUG-43636) where someone asked me to create a bug report for the Visual Studio Add-in.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              mecfc Miguel Costa
              madock manuel
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes