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.7k 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 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

    kkoehneK 1 Reply Last reply
    0
    • V victor_wen

      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

      kkoehneK Offline
      kkoehneK Offline
      kkoehne
      Moderators
      wrote on 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
      0
      • kkoehneK kkoehne

        @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 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?

        kkoehneK JoeCFDJ 2 Replies Last reply
        0
        • V victor_wen

          @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?

          kkoehneK Offline
          kkoehneK Offline
          kkoehne
          Moderators
          wrote on 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
          • SGaistS SGaist moved this topic from Qt in Education on
          • V Offline
            V Offline
            victor_wen
            wrote on 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.

            jsulmJ 1 Reply Last reply
            0
            • V victor_wen

              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.

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on 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

              kkoehneK 1 Reply Last reply
              0
              • jsulmJ jsulm

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

                kkoehneK Offline
                kkoehneK Offline
                kkoehne
                Moderators
                wrote on 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
                0
                • V victor_wen

                  @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?

                  JoeCFDJ Offline
                  JoeCFDJ Offline
                  JoeCFD
                  wrote on 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
                  • kkoehneK kkoehne

                    @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 last edited by
                    #9

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

                    kkoehneK 1 Reply Last reply
                    0
                    • V victor_wen

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

                      kkoehneK Offline
                      kkoehneK Offline
                      kkoehne
                      Moderators
                      wrote on 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
                      • V victor_wen marked this topic as a question on
                      • V victor_wen marked this topic as a regular topic on
                      • V victor_wen marked this topic as a question on
                      • V victor_wen has marked this topic as solved on

                      • Login

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