Building and Debugging Qt Projects on Linux with VisualGDB

In this tutorial we create, build and debug a Qt application on Linux with Visual Studio.

Before you begin, make sure that VisualGDB 3.1 or later is installed.

  1. Start Visual Studio. Go to ‘File->New Project’. Select ‘VisualGDB->Linux Project Wizard’. Choose a name and location for the project and press ‘OK’.01-newproject
  2. On the first page choose ‘Create a new project’, ‘Application’ and change the project template to ‘A QT4-based application’. Press ‘Next’.02-QtProject
  3. Choose a remote computer to build the project on. You may have to make a new SSH connection for it.03-remote
  4. When pressing ‘Next’, VisualGDB will try to verify that the remote machine has all the tools needed. If prompted to install Qt automatically on the Linux machine, press ‘Yes’. 04-detected
  5. On the last page of the wizard, there is no need to make changes. Press ‘Finish’. 05-lastpage
  6. Build the project. 06-build
  7. Set a breakpoint in the ‘ButtonClicked’ function. Start debugging. 07-bp
  8. Either install X Server or browse to its location. 08-xserver
  9. Once X Server starts, the app is displayed. The example project just has one simple button. Click on the button. 10-app
  10. The breakpoint will be hit. 11-bpstop