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. how to fix these build errors(msvc2019 64bit)

how to fix these build errors(msvc2019 64bit)

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 4 Posters 2.6k 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.
  • V Offline
    V Offline
    victor_wen
    wrote on 14 Apr 2023, 01:54 last edited by
    #1

    I'm new to QT. i just installed the c++ development tool from VS and Microsoft Visual C++ 2015-2019 Redistributable (X64). QT indicate that i have correct kit. However, some mistakes happen when i build files. Here's the screenshot.
    aa1185bc-d6c9-43d3-b568-de0b9ab24110-image.png

    K 1 Reply Last reply 14 Apr 2023, 06:56
    0
    • V victor_wen
      14 Apr 2023, 01:54

      I'm new to QT. i just installed the c++ development tool from VS and Microsoft Visual C++ 2015-2019 Redistributable (X64). QT indicate that i have correct kit. However, some mistakes happen when i build files. Here's the screenshot.
      aa1185bc-d6c9-43d3-b568-de0b9ab24110-image.png

      K Offline
      K Offline
      kkoehne
      Moderators
      wrote on 14 Apr 2023, 06:56 last edited by kkoehne
      #2

      @victor_wen , as you said the compiler/toolchain setup looks correct. You could verify this by compiling and linking a simple hello world program, e.g. created by a project wizard.

      The warnings and errors you see seem to stem from the project you have opened though, which seems not compatible with MSVC; the very first warning indicates that you have for instance a

      #pragma GCC
      

      in the sources that the MSVC compiler doesn't know. So I suggest either to select a MinGW kti (like the Desktop Qt 5.15.2 MinGW 64-bit you have), or fix the sources to be compatible with MSVC. How to do this very much depends on the project at hand.

      Director R&D, The Qt Company

      V 1 Reply Last reply 14 Apr 2023, 08:51
      0
      • K kkoehne
        14 Apr 2023, 06:56

        @victor_wen , as you said the compiler/toolchain setup looks correct. You could verify this by compiling and linking a simple hello world program, e.g. created by a project wizard.

        The warnings and errors you see seem to stem from the project you have opened though, which seems not compatible with MSVC; the very first warning indicates that you have for instance a

        #pragma GCC
        

        in the sources that the MSVC compiler doesn't know. So I suggest either to select a MinGW kti (like the Desktop Qt 5.15.2 MinGW 64-bit you have), or fix the sources to be compatible with MSVC. How to do this very much depends on the project at hand.

        V Offline
        V Offline
        victor_wen
        wrote on 14 Apr 2023, 08:51 last edited by
        #3

        @kkoehne Thanks for your advice. I can't use MinGW because of the request of project. besides, I have tried the example in QT. What confuses me most is the errors are exactly the same as the errors when I don't get correct MSVC kit. I thought it might be that
        I have installed and uninstalled it for several times. Is there the possibility of it? How can I do to solve this?

        K J 2 Replies Last reply 17 Apr 2023, 10:52
        0
        • V victor_wen
          14 Apr 2023, 08:51

          @kkoehne Thanks for your advice. I can't use MinGW because of the request of project. besides, I have tried the example in QT. What confuses me most is the errors are exactly the same as the errors when I don't get correct MSVC kit. I thought it might be that
          I have installed and uninstalled it for several times. Is there the possibility of it? How can I do to solve this?

          K Offline
          K Offline
          kkoehne
          Moderators
          wrote on 17 Apr 2023, 10:52 last edited by
          #4

          @victor_wen , can you show the full warning / error, including compiler line?

          It looks like you're using MinGW headers with MSVC. Do you have by chance set the environment variable INCLUDE manually?

          Director R&D, The Qt Company

          1 Reply Last reply
          0
          • S SGaist moved this topic from Qt in Education on 17 Apr 2023, 19:49
          • V Offline
            V Offline
            victor_wen
            wrote on 20 Apr 2023, 02:02 last edited by
            #5

            I pasted the error messages into text. Here is the link of it [link text](https://kdocs.cn/l/ckfwRT42MWw1?f=201
            [文件]error.docx).Besides, I didn't modify the environment variable by chance.

            J 1 Reply Last reply 20 Apr 2023, 05:17
            0
            • V victor_wen
              20 Apr 2023, 02:02

              I pasted the error messages into text. Here is the link of it [link text](https://kdocs.cn/l/ckfwRT42MWw1?f=201
              [文件]error.docx).Besides, I didn't modify the environment variable by chance.

              J Online
              J Online
              jsulm
              Lifetime Qt Champion
              wrote on 20 Apr 2023, 05:17 last edited by
              #6

              @victor_wen You're uploading error messages as Word document?!
              Why don't you simply post them here as plain text?

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              K 1 Reply Last reply 20 Apr 2023, 09:20
              0
              • J jsulm
                20 Apr 2023, 05:17

                @victor_wen You're uploading error messages as Word document?!
                Why don't you simply post them here as plain text?

                K Offline
                K Offline
                kkoehne
                Moderators
                wrote on 20 Apr 2023, 09:20 last edited by
                #7

                @victor_wen , indeed, feel free to just post short snippets here , or use plain-text code sharing services like https://pastebin.com/ .

                Anyway:

                D:\include\stdint.h
                

                a) Having a top level include in D: is ... unusual. Did you place it there? Or do you do some magic with virtual drive folders? Where is the actual code you compile?
                b) Why does MSVC look into D:\include? Provided that you don't have any source files in D:\ itself, is INCLUDEDIR is set in your environment, or does your build system (CMakeList.txt, .pro file, Visual Studio solution) somehow explicitly add D:\include to the include directories to be searched by the compiler?

                Director R&D, The Qt Company

                V 1 Reply Last reply 22 Apr 2023, 10:12
                0
                • V victor_wen
                  14 Apr 2023, 08:51

                  @kkoehne Thanks for your advice. I can't use MinGW because of the request of project. besides, I have tried the example in QT. What confuses me most is the errors are exactly the same as the errors when I don't get correct MSVC kit. I thought it might be that
                  I have installed and uninstalled it for several times. Is there the possibility of it? How can I do to solve this?

                  J Offline
                  J Offline
                  JoeCFD
                  wrote on 20 Apr 2023, 20:16 last edited by
                  #8

                  @victor_wen Can you click the Desktop Qt 5.15.2 MSVC 2015 or 2019 64bit to check if the Compiler selection is correct.? After mouse click, the selection will be showed. Post the picture here.

                  1 Reply Last reply
                  0
                  • K kkoehne
                    20 Apr 2023, 09:20

                    @victor_wen , indeed, feel free to just post short snippets here , or use plain-text code sharing services like https://pastebin.com/ .

                    Anyway:

                    D:\include\stdint.h
                    

                    a) Having a top level include in D: is ... unusual. Did you place it there? Or do you do some magic with virtual drive folders? Where is the actual code you compile?
                    b) Why does MSVC look into D:\include? Provided that you don't have any source files in D:\ itself, is INCLUDEDIR is set in your environment, or does your build system (CMakeList.txt, .pro file, Visual Studio solution) somehow explicitly add D:\include to the include directories to be searched by the compiler?

                    V Offline
                    V Offline
                    victor_wen
                    wrote on 22 Apr 2023, 10:12 last edited by
                    #9

                    @kkoehne thank you. The include folder confused qt, it turns
                    good after I delete this folder.

                    K 1 Reply Last reply 24 Apr 2023, 08:44
                    0
                    • V victor_wen
                      22 Apr 2023, 10:12

                      @kkoehne thank you. The include folder confused qt, it turns
                      good after I delete this folder.

                      K Offline
                      K Offline
                      kkoehne
                      Moderators
                      wrote on 24 Apr 2023, 08:44 last edited by
                      #10

                      @victor_wen

                      Great. Feel free to 'resolve' this topic then.

                      Director R&D, The Qt Company

                      1 Reply Last reply
                      0
                      • V victor_wen marked this topic as a regular topic on 29 Apr 2023, 09:14
                      • V victor_wen marked this topic as a question on 29 Apr 2023, 09:14
                      • V victor_wen marked this topic as a regular topic on 29 Apr 2023, 09:14
                      • V victor_wen marked this topic as a question on 29 Apr 2023, 09:15
                      • V victor_wen has marked this topic as solved on 29 Apr 2023, 09:15

                      1/10

                      14 Apr 2023, 01:54

                      • Login

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