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.
- Start Visual Studio. Go to ‘File->New Project’. Select ‘VisualGDB->Linux Project Wizard’. Choose a name and location for the project and press ‘OK’.
- On the first page choose ‘Create a new project’, ‘Application’ and change the project template to ‘A QT4-based application’. Press ‘Next’.
- Choose a remote computer to build the project on. You may have to make a new SSH connection for it.
- 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’.
- On the last page of the wizard, there is no need to make changes. Press ‘Finish’.
- Build the project.
- Set a breakpoint in the ‘ButtonClicked’ function. Start debugging.
- Either install X Server or browse to its location.
- Once X Server starts, the app is displayed. The example project just has one simple button. Click on the button.
- The breakpoint will be hit.