{"id":154,"date":"2014-02-04T17:39:31","date_gmt":"2014-02-04T17:39:31","guid":{"rendered":"http:\/\/visualgdb.com\/w\/?p=154"},"modified":"2015-07-19T09:02:23","modified_gmt":"2015-07-19T16:02:23","slug":"linux-qt","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/tutorials\/linux\/qt\/","title":{"rendered":"Building and Debugging Qt Projects on Linux with VisualGDB"},"content":{"rendered":"<p>In this tutorial we create, build and debug a Qt application on Linux with Visual Studio.<\/p>\n<p>Before you begin, make sure that <a href=\"\/download\">VisualGDB 3.1<\/a> or later is installed.<\/p>\n<ol>\n<li>Start Visual Studio. Go to &#8216;File-&gt;New Project&#8217;. Select &#8216;VisualGDB-&gt;Linux Project Wizard&#8217;. Choose a name and location for the project and press &#8216;OK&#8217;.<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/linux\/qt\/01-newproject.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/linux\/qt\/01-newproject.png\" alt=\"01-newproject\" width=\"700\" height=\"394\" \/><\/a><\/li>\n<li>On the first page choose &#8216;Create a new project&#8217;, &#8216;Application&#8217; and change the project template to &#8216;A QT4-based application&#8217;. Press &#8216;Next&#8217;.<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/linux\/qt\/02-QtProject.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/linux\/qt\/02-QtProject.png\" alt=\"02-QtProject\" width=\"696\" height=\"628\" \/><\/a><\/li>\n<li>Choose a remote computer to build the project on. You may have to make a new SSH connection for it.<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/linux\/qt\/03-remote.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/linux\/qt\/03-remote.png\" alt=\"03-remote\" width=\"696\" height=\"628\" \/><\/a><\/li>\n<li>When pressing &#8216;Next&#8217;, 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 &#8216;Yes&#8217;. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/linux\/qt\/04-detected.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/linux\/qt\/04-detected.png\" alt=\"04-detected\" width=\"459\" height=\"184\" \/><\/a><\/li>\n<li>On the last page of the wizard, there is no need to make changes. Press &#8216;Finish&#8217;. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/linux\/qt\/05-lastpage.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/linux\/qt\/05-lastpage.png\" alt=\"05-lastpage\" width=\"696\" height=\"628\" \/><\/a><\/li>\n<li>Build the project. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/linux\/qt\/06-build.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/linux\/qt\/06-build.png\" alt=\"06-build\" width=\"700\" height=\"479\" \/><\/a><\/li>\n<li>Set a breakpoint in the &#8216;ButtonClicked&#8217; function. Start debugging. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/linux\/qt\/07-bp.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/linux\/qt\/07-bp.png\" alt=\"07-bp\" width=\"700\" height=\"550\" \/><\/a><\/li>\n<li>Either install X Server or browse to its location. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/linux\/qt\/08-xserver.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/linux\/qt\/08-xserver.png\" alt=\"08-xserver\" width=\"537\" height=\"292\" \/><\/a><\/li>\n<li>Once X Server starts, the app is displayed. The example project just has one simple button. Click on the button. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/linux\/qt\/10-app.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/linux\/qt\/10-app.png\" alt=\"10-app\" width=\"416\" height=\"338\" \/><\/a><\/li>\n<li>The breakpoint will be hit. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/linux\/qt\/11-bpstop.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-10\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/linux\/qt\/11-bpstop.png\" alt=\"11-bpstop\" width=\"700\" height=\"550\" \/><\/a><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial we create, build and debug a Qt application on Linux with Visual Studio. Before you begin, make<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[92],"tags":[33,46],"_links":{"self":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/154"}],"collection":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/comments?post=154"}],"version-history":[{"count":1,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/154\/revisions"}],"predecessor-version":[{"id":214,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/154\/revisions\/214"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}