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?
Servers for Qt installer are currently down

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 9 Dec 2018, 21:15 last edited by kitfox 12 Sept 2018, 21:18
    #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?

    J 1 Reply Last reply 10 Dec 2018, 06:02
    0
    • D Offline
      D Offline
      dheerendra
      Qt Champions 2022
      wrote on 10 Dec 2018, 01:48 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 10 Dec 2018, 19:02
      1
      • K kitfox
        9 Dec 2018, 21:15

        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?

        J Online
        J Online
        jsulm
        Lifetime Qt Champion
        wrote on 10 Dec 2018, 06:02 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 10 Dec 2018, 19:01 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
          • D dheerendra
            10 Dec 2018, 01:48

            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 10 Dec 2018, 19:02 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

            1/5

            9 Dec 2018, 21:15

            • Login

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