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. Missing ingredients and build steps in qmake generated Visual Studio project
Forum Updated to NodeBB v4.3 + New Features

Missing ingredients and build steps in qmake generated Visual Studio project

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 237 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.
  • K Offline
    K Offline
    kakyoism
    wrote on last edited by kakyoism
    #1

    New user here.

    The qmake-Xcode pipeline works perfectly for me on macOS 10.14 / Xcode 10.3;

    When dev on Windows 10 / VS 2017, however, a few glitches are noticed.

    Glitch 1: Generating VS project

    Running qmake -project fails with complaints about environment setup. This was solved by adding

    call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
    

    to %QT_DIR%\bin\qtenv2.bat by hand.

    Then, I successfully generated a Visual Studio project with:

    qmake -project
    qmake -tp vc myproj.pro
    

    Glitch 2: Building the VS project

    Then when building, I got this: Cannot find #include file for widgets, and solved it by adding QT += widgets to mproj.pro by hand.

    Glitch 3: Running the app

    Upon running, the app crashes upon running complaining about

    could not find or load the Qt platform plugin "windows" in "",
    

    Helped by this post:
    https://forum.qt.io/topic/90293/could-not-find-or-load-the-qt-platform-plugin-windows-in

    I then realized that it's the missing deployment procedure, and added a Post-Build Event to VS.

    echo "Post Build Event"
    windeployqt $(TargetPath)
    

    Then everything works.

    Am I missing anything or are these glitches meant to be fixed by hand on user side?

    I feel that they could be easily fixed in qmake with its generated projects. So that VS users could get a similar smooth experience with the Xcode users.

    aha_1980A 1 Reply Last reply
    0
    • K kakyoism

      New user here.

      The qmake-Xcode pipeline works perfectly for me on macOS 10.14 / Xcode 10.3;

      When dev on Windows 10 / VS 2017, however, a few glitches are noticed.

      Glitch 1: Generating VS project

      Running qmake -project fails with complaints about environment setup. This was solved by adding

      call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
      

      to %QT_DIR%\bin\qtenv2.bat by hand.

      Then, I successfully generated a Visual Studio project with:

      qmake -project
      qmake -tp vc myproj.pro
      

      Glitch 2: Building the VS project

      Then when building, I got this: Cannot find #include file for widgets, and solved it by adding QT += widgets to mproj.pro by hand.

      Glitch 3: Running the app

      Upon running, the app crashes upon running complaining about

      could not find or load the Qt platform plugin "windows" in "",
      

      Helped by this post:
      https://forum.qt.io/topic/90293/could-not-find-or-load-the-qt-platform-plugin-windows-in

      I then realized that it's the missing deployment procedure, and added a Post-Build Event to VS.

      echo "Post Build Event"
      windeployqt $(TargetPath)
      

      Then everything works.

      Am I missing anything or are these glitches meant to be fixed by hand on user side?

      I feel that they could be easily fixed in qmake with its generated projects. So that VS users could get a similar smooth experience with the Xcode users.

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

      Hi @kakyoism

      Running qmake -project fails with complaints about environment setup. This was solved by adding

      qmake -project only creates a stub. You have to edit it by hand afterwards to get a functional project file.

      Setting up the environment is nothing anyone else can do for you, don't you agree?

      And deployment is a necessary step on every platform, I agree that this could be a bit more automated (like a make deploy step). But unfortunately we don't have it.

      I feel that they could be easily fixed in qmake with its generated projects.

      As Qt is switching to CMake, qmake will only get fixes from now on. Adding more functionality is quite unlikely.

      Regards

      Qt has to stay free or it will die.

      1 Reply Last reply
      2

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved