Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. while the qt 6.5.1 is Properly installed and also qt vs tools is Properly installed on visual Studio, why I will get a lots of errors about Qt in a normal project using Visual Studio IDE?

while the qt 6.5.1 is Properly installed and also qt vs tools is Properly installed on visual Studio, why I will get a lots of errors about Qt in a normal project using Visual Studio IDE?

Scheduled Pinned Locked Moved Solved Qt 6
visual studio
15 Posts 4 Posters 3.0k 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.
  • C Chris Kawa
    12 Jun 2023, 17:52

    @bozorgmehr said:

    I click qt modules an edit box will came, and there is no lists: why?

    Sounds like you don't have your installed Qt added to the extension options. Open Tools -> Options -> Qt -> Versions and add your Qt installation directory there. Then you can go to your project options and select that version for your project. This should populate the list of available modules.

    B Offline
    B Offline
    bozorgmehr
    wrote on 13 Jun 2023, 07:47 last edited by
    #5

    okay, and what about this errors about the msvcp folder in qt? I then created another qt widgets application, but again the saim errors.
    I will send some of the errors here.
    Severity Code Description Project File Line Suppression State
    Error (active) E0325 inline specifier allowed on function declarations only QtWidgetsApplication5 E:\Qt\Qt\6.6.0\msvc2019_64\include\QtCore\qcontainerinfo.h 76
    Error (active) E2386 'constexpr' is not valid here QtWidgetsApplication5 E:\Qt\Qt\6.6.0\msvc2019_64\include\QtCore\qanystringview.h 301
    Error (active) E2860 a nonstatic data member cannot be declared as inline QtWidgetsApplication5 E:\Qt\Qt\6.6.0\msvc2019_64\include\QtCore\qanystringview.h 301
    Error C1189 #error: "Qt requires a C++17 compiler, and a suitable value for __cplusplus. On MSVC, you must pass the /Zc:__cplusplus option to the compiler." (compiling source file QtWidgetsApplication5.cpp) QtWidgetsApplication5 E:\Qt\Qt\6.6.0\msvc2019_64\include\QtCore\qcompilerdetection.h 1223
    how to fix?

    C 1 Reply Last reply 13 Jun 2023, 19:08
    0
    • B bozorgmehr
      13 Jun 2023, 07:47

      okay, and what about this errors about the msvcp folder in qt? I then created another qt widgets application, but again the saim errors.
      I will send some of the errors here.
      Severity Code Description Project File Line Suppression State
      Error (active) E0325 inline specifier allowed on function declarations only QtWidgetsApplication5 E:\Qt\Qt\6.6.0\msvc2019_64\include\QtCore\qcontainerinfo.h 76
      Error (active) E2386 'constexpr' is not valid here QtWidgetsApplication5 E:\Qt\Qt\6.6.0\msvc2019_64\include\QtCore\qanystringview.h 301
      Error (active) E2860 a nonstatic data member cannot be declared as inline QtWidgetsApplication5 E:\Qt\Qt\6.6.0\msvc2019_64\include\QtCore\qanystringview.h 301
      Error C1189 #error: "Qt requires a C++17 compiler, and a suitable value for __cplusplus. On MSVC, you must pass the /Zc:__cplusplus option to the compiler." (compiling source file QtWidgetsApplication5.cpp) QtWidgetsApplication5 E:\Qt\Qt\6.6.0\msvc2019_64\include\QtCore\qcompilerdetection.h 1223
      how to fix?

      C Offline
      C Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on 13 Jun 2023, 19:08 last edited by
      #6

      @bozorgmehr As the error says Qt6 requires at least C++17 standard, so go to your project settings -> General -> C++ Language Standard and make sure it's set to C++17 (or higher).

      B 1 Reply Last reply 14 Jun 2023, 17:17
      1
      • C Chris Kawa
        13 Jun 2023, 19:08

        @bozorgmehr As the error says Qt6 requires at least C++17 standard, so go to your project settings -> General -> C++ Language Standard and make sure it's set to C++17 (or higher).

        B Offline
        B Offline
        bozorgmehr
        wrote on 14 Jun 2023, 17:17 last edited by
        #7

        @Chris-Kawa okay, I've changed the project settings and it Compiled successfully, but when running the EXE file I will get these errors
        QWidgetsApplication8.exe - System Error dialog The code execution cannot proceed because Qt6Cored.dll was not found. Reinstalling the program may fix this problem.
        QtWidgetsApplication8.exe - System Error dialog The code execution cannot proceed because Qt6Widgetsd.dll was not found. Reinstalling the program may fix this problem.
        I'm sure that the QT installation path is added to path in Environment Variables.
        But still this error is exists: I even used the clean option and then rebuild, but still this error is.

        C C 2 Replies Last reply 14 Jun 2023, 17:20
        0
        • B bozorgmehr
          14 Jun 2023, 17:17

          @Chris-Kawa okay, I've changed the project settings and it Compiled successfully, but when running the EXE file I will get these errors
          QWidgetsApplication8.exe - System Error dialog The code execution cannot proceed because Qt6Cored.dll was not found. Reinstalling the program may fix this problem.
          QtWidgetsApplication8.exe - System Error dialog The code execution cannot proceed because Qt6Widgetsd.dll was not found. Reinstalling the program may fix this problem.
          I'm sure that the QT installation path is added to path in Environment Variables.
          But still this error is exists: I even used the clean option and then rebuild, but still this error is.

          C Offline
          C Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 14 Jun 2023, 17:20 last edited by
          #8

          @bozorgmehr said in while the qt 6.5.1 is Properly installed and also qt vs tools is Properly installed on visual Studio, why I will get a lots of errors about Qt in a normal project using Visual Studio IDE?:

          I'm sure that the QT installation path is added to path in Environment Variables.

          If it would then you would not get those error.

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

          B 1 Reply Last reply 14 Jun 2023, 17:31
          0
          • C Christian Ehrlicher
            14 Jun 2023, 17:20

            @bozorgmehr said in while the qt 6.5.1 is Properly installed and also qt vs tools is Properly installed on visual Studio, why I will get a lots of errors about Qt in a normal project using Visual Studio IDE?:

            I'm sure that the QT installation path is added to path in Environment Variables.

            If it would then you would not get those error.

            B Offline
            B Offline
            bozorgmehr
            wrote on 14 Jun 2023, 17:31 last edited by
            #9

            When I said that I have added the qt installed path to the path variable, but I get an error, why do you say that if you had added the qt installed path to the path variable, you would not get an error? I am saying that I have done this but I get an error

            C J 2 Replies Last reply 14 Jun 2023, 18:25
            0
            • B bozorgmehr
              14 Jun 2023, 17:31

              When I said that I have added the qt installed path to the path variable, but I get an error, why do you say that if you had added the qt installed path to the path variable, you would not get an error? I am saying that I have done this but I get an error

              C Offline
              C Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on 14 Jun 2023, 18:25 last edited by
              #10

              @bozorgmehr said in while the qt 6.5.1 is Properly installed and also qt vs tools is Properly installed on visual Studio, why I will get a lots of errors about Qt in a normal project using Visual Studio IDE?:

              I am saying that I have done this but I get an error

              Then may it be so - happy searching for another solution.
              When the correct path to a dll is in the PATH environment var then noone will get an error that this dll can not be found.

              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
              • B bozorgmehr
                14 Jun 2023, 17:31

                When I said that I have added the qt installed path to the path variable, but I get an error, why do you say that if you had added the qt installed path to the path variable, you would not get an error? I am saying that I have done this but I get an error

                J Offline
                J Offline
                JonB
                wrote on 14 Jun 2023, 18:37 last edited by
                #11

                @bozorgmehr
                Out of interest, what happens if you try to run your executable from a Command Prompt, quite outside of VS?

                1 Reply Last reply
                0
                • B bozorgmehr
                  14 Jun 2023, 17:17

                  @Chris-Kawa okay, I've changed the project settings and it Compiled successfully, but when running the EXE file I will get these errors
                  QWidgetsApplication8.exe - System Error dialog The code execution cannot proceed because Qt6Cored.dll was not found. Reinstalling the program may fix this problem.
                  QtWidgetsApplication8.exe - System Error dialog The code execution cannot proceed because Qt6Widgetsd.dll was not found. Reinstalling the program may fix this problem.
                  I'm sure that the QT installation path is added to path in Environment Variables.
                  But still this error is exists: I even used the clean option and then rebuild, but still this error is.

                  C Offline
                  C Offline
                  Chris Kawa
                  Lifetime Qt Champion
                  wrote on 14 Jun 2023, 19:37 last edited by
                  #12

                  @bozorgmehr said:

                  I'm sure that the QT installation path is added to path in Environment Variables

                  Don't add Qt installation to your PATH. You would have to add both the bin and plugin directories. That's a terrible practice and you can't expect your users to do so either. You should properly deploy your app. See windeployqt. Run it on your exe and it will copy all the necessary files to your app dir.

                  C B 2 Replies Last reply 14 Jun 2023, 19:52
                  1
                  • C Chris Kawa
                    14 Jun 2023, 19:37

                    @bozorgmehr said:

                    I'm sure that the QT installation path is added to path in Environment Variables

                    Don't add Qt installation to your PATH. You would have to add both the bin and plugin directories. That's a terrible practice and you can't expect your users to do so either. You should properly deploy your app. See windeployqt. Run it on your exe and it will copy all the necessary files to your app dir.

                    C Offline
                    C Offline
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote on 14 Jun 2023, 19:52 last edited by
                    #13

                    @Chris-Kawa said in while the qt 6.5.1 is Properly installed and also qt vs tools is Properly installed on visual Studio, why I will get a lots of errors about Qt in a normal project using Visual Studio IDE?:

                    Run it on your exe and it will copy all the necessary files to your app dir.

                    If my build system would copy me all the Qt dlls around on every time I build the project I would throw it away. Not to say that imo it does not copy the debug dlls (but I may be wrong) so it does not work for debug.

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

                    C 1 Reply Last reply 14 Jun 2023, 20:04
                    0
                    • C Christian Ehrlicher
                      14 Jun 2023, 19:52

                      @Chris-Kawa said in while the qt 6.5.1 is Properly installed and also qt vs tools is Properly installed on visual Studio, why I will get a lots of errors about Qt in a normal project using Visual Studio IDE?:

                      Run it on your exe and it will copy all the necessary files to your app dir.

                      If my build system would copy me all the Qt dlls around on every time I build the project I would throw it away. Not to say that imo it does not copy the debug dlls (but I may be wrong) so it does not work for debug.

                      C Offline
                      C Offline
                      Chris Kawa
                      Lifetime Qt Champion
                      wrote on 14 Jun 2023, 20:04 last edited by
                      #14

                      @Christian-Ehrlicher said:

                      If my build system would copy me all the Qt dlls around on every time I build the project I would throw it away.

                      Thankfully most build systems are very configurable and you can do it the exact amount of times that is needed. Usually once :)

                      And I know Linux people prefer to have one copy of libraries on the system, but, at least on Windows, local deployment is the only sane way to have your apps. PATH should be off limits for such things. OP already mentioned two different versions of Qt installed. Adding any of them to PATH is a recipe for disaster sooner or later (probably sooner).

                      Not to say that imo it does not copy the debug dlls (but I may be wrong) so it does not work for debug.

                      Good news - it does!

                      1 Reply Last reply
                      0
                      • C Chris Kawa
                        14 Jun 2023, 19:37

                        @bozorgmehr said:

                        I'm sure that the QT installation path is added to path in Environment Variables

                        Don't add Qt installation to your PATH. You would have to add both the bin and plugin directories. That's a terrible practice and you can't expect your users to do so either. You should properly deploy your app. See windeployqt. Run it on your exe and it will copy all the necessary files to your app dir.

                        B Offline
                        B Offline
                        bozorgmehr
                        wrote on 15 Jun 2023, 07:55 last edited by
                        #15

                        thanks, my problem solved.

                        1 Reply Last reply
                        0
                        • B bozorgmehr deleted this topic on 15 Jun 2023, 07:56
                        • B bozorgmehr restored this topic on 15 Jun 2023, 07:57
                        • B bozorgmehr has marked this topic as solved on 15 Jun 2023, 07:57

                        14/15

                        14 Jun 2023, 20:04

                        • Login

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