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 build and run in Visual Studio?

How to build and run in Visual Studio?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 1.3k 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
    kitfox
    wrote on last edited by kitfox
    #1

    I have a simple project hat I've been working on it QtCreator and wanted to see if I could compile in Visual Studio. It only has one .pro file and uses qmake to build.

    I opened Visual Studio (Qt tools were already installed) and selected Qt VS Tools/Open Qt Project File... I then browsed to my .pro file. Visual studio opened it and generated a few files. When it seemed done, I clicked on the run button labled Local Windows Debugger to compile and run my program. However, all I got was an error message saying "cmd.exe" exited with code 2.

    Did I forget a step?

    jsulmJ 1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      Are you working in Qt Creator with Qt Visual Studio libraries &MSVC compiler ? Did you install the visual studio plugin ?

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      K 1 Reply Last reply
      1
      • K kitfox

        I have a simple project hat I've been working on it QtCreator and wanted to see if I could compile in Visual Studio. It only has one .pro file and uses qmake to build.

        I opened Visual Studio (Qt tools were already installed) and selected Qt VS Tools/Open Qt Project File... I then browsed to my .pro file. Visual studio opened it and generated a few files. When it seemed done, I clicked on the run button labled Local Windows Debugger to compile and run my program. However, all I got was an error message saying "cmd.exe" exited with code 2.

        Did I forget a step?

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @kitfox As @dheerendra suggested you can use Visual C++ compiler in QtCreator without using Vsual Studio. Do you really need to use Visual Studio?

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

        1 Reply Last reply
        1
        • K Offline
          K Offline
          kitfox
          wrote on last edited by
          #4

          I used Visual Studio IDE because I thought that's what you were supposed to do. At this point I'm just testing it out to see how well it works. Was also interested in seeing if it might provide a better debugging experience.

          1 Reply Last reply
          0
          • dheerendraD dheerendra

            Are you working in Qt Creator with Qt Visual Studio libraries &MSVC compiler ? Did you install the visual studio plugin ?

            K Offline
            K Offline
            kitfox
            wrote on last edited by
            #5

            @dheerendra I installed the Qt plugin for Visual studio. I don't know the answers to your other questions. I just went with the defaults.

            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