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. Creating a Visual Studio Project of qtbase for QT 5
Forum Updated to NodeBB v4.3 + New Features

Creating a Visual Studio Project of qtbase for QT 5

Scheduled Pinned Locked Moved Solved Installation and Deployment
8 Posts 3 Posters 533 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.
  • S Offline
    S Offline
    sefo
    wrote on last edited by sefo
    #1

    As I want to change the functionality of a certain feature of the QT library (more exactly qtbase), I want to create Visual Studio project files from the source code. Unfortunaltely I have to do this for QT 5 (more exactly QT 5.15.2). So I want to know what is the intended method for creating VS project files from the source code. For past duties I created such files also for QT 6, which was straight forward using qt-cmake, using the right generator and having CMakeLists.txt files (although also here errors occured which happily could be ignored). This gave me a whole hirarchy of projects with a "super"-project called "ALL_BUILD.vcxproj". This I want here too if possible. For Qt 5 this does, however, not seem to be so easy as there are only .pro files present. I tried to create the Visual Studio project files the for .pro files intended way using <path to qmake.exe>\qmake.exe -tp vc -r <path to qtbase.pro>\qtbase.pro, but got an error that QMAKE_MSC_VER is not set. I set it then to 1940 (my Visual Studio version is Visual Studio 2022, version 17.10.1.) in the msvc-version.conf-file but still got the error, but only the first time I executed the code written above. Executing this code a second time, this part worked. Afterwards, however, another error "Project ERROR: Library 'pcre2' is not defined." popped up. I also think that this is not the intended way for qtbase, as in "https://forum.qt.io/topic/114743/problem-building-qtbase-from-source/4" SGaist wrote that qtbase is not built with qmake. Any help is greatly appreciated.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sefo
      wrote on last edited by
      #6

      Using "nmake" in subdirectories of qtbase with a Makefile in the configured directory, I am able now to build single dlls. Still needs a few minutes, but its managable. @Christian-Ehrlicher Thank you for the idea.

      1 Reply Last reply
      0
      • Christian EhrlicherC Online
        Christian EhrlicherC Online
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #2

        I would simply build it on the command line and then create a solution with the testcase. This is much easier.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sefo
          wrote on last edited by sefo
          #3

          That is an solution, true. But then I would have to wait half an hour or so each time after debugging to recompile the whole of qtbase, without recompiling only say widgets or core. As I am not the most familiar with Qt yet, and there is still a lot of trial and error, I would rather favour a Visual Studio project. But thank you nevertheless!

          Christian EhrlicherC 1 Reply Last reply
          0
          • S sefo

            That is an solution, true. But then I would have to wait half an hour or so each time after debugging to recompile the whole of qtbase, without recompiling only say widgets or core. As I am not the most familiar with Qt yet, and there is still a lot of trial and error, I would rather favour a Visual Studio project. But thank you nevertheless!

            Christian EhrlicherC Online
            Christian EhrlicherC Online
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #4

            @sefo said in Creating a Visual Studio Project of qtbase for QT 5:

            That is an solution, true. But then I would have to wait half an hour or so each time after debugging to recompile the whole of qtbase, without recompiling

            Why? When you change something in QtWidgets a ninja Widgets builds in seconds (when not a global header was touched)...

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            S 1 Reply Last reply
            0
            • Christian EhrlicherC Christian Ehrlicher

              @sefo said in Creating a Visual Studio Project of qtbase for QT 5:

              That is an solution, true. But then I would have to wait half an hour or so each time after debugging to recompile the whole of qtbase, without recompiling

              Why? When you change something in QtWidgets a ninja Widgets builds in seconds (when not a global header was touched)...

              S Offline
              S Offline
              sefo
              wrote on last edited by sefo
              #5

              @Christian-Ehrlicher Oh, I did not know that this is possible. Thank you, I will try that tomorrow.

              1 Reply Last reply
              0
              • S Offline
                S Offline
                sefo
                wrote on last edited by
                #6

                Using "nmake" in subdirectories of qtbase with a Makefile in the configured directory, I am able now to build single dlls. Still needs a few minutes, but its managable. @Christian-Ehrlicher Thank you for the idea.

                1 Reply Last reply
                0
                • S sefo has marked this topic as solved on
                • Christian EhrlicherC Online
                  Christian EhrlicherC Online
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on last edited by
                  #7

                  Use ninja instead nmake as cmake generator

                  Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                  Visit the Qt Academy at https://academy.qt.io/catalog

                  1 Reply Last reply
                  0
                  • S Online
                    S Online
                    SimonSchroeder
                    wrote on last edited by
                    #8

                    Your original problem most likely stems from the fact that you didn't have MSVC properly set up in your command line. One way is to start the Developer Command Prompt for your Visual Studio version and execute qmake.exe inside that prompt. Another way is to call something like call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64 on your command line to set up MSVC and after that call qmake.exe.

                    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