{"id":1088,"date":"2015-09-30T11:13:31","date_gmt":"2015-09-30T18:13:31","guid":{"rendered":"http:\/\/visualgdb.com\/w\/?p=1088"},"modified":"2019-06-04T13:44:24","modified_gmt":"2019-06-04T20:44:24","slug":"cross-compiling-qt5-projects-for-beaglebone-debian","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/tutorials\/beaglebone\/qt5\/app\/","title":{"rendered":"Cross-compiling Qt5 Applications for Beaglebonewith Visual Studio"},"content":{"rendered":"<p>This tutorial shows how to cross-compile a simple Qt5 application for the Beaglebone Black board running Debian using Visual Studio and VisualGDB.<\/p>\n<p>Before you begin, ensure you you can connect to your Beaglebone via SSH and are using an SD card image compatible with <a href=\"http:\/\/gnutoolchains.com\/beaglebone\/\">one of our toolchains<\/a>.<\/p>\n<ol>\n<li>Start Visual Studio and open VisualGDB Linux project Wizard:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/01-newprj-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4686\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/01-newprj-1.png\" alt=\"\" width=\"941\" height=\"653\" \/><\/a><\/li>\n<li>On the first page select &#8220;Create a new project -&gt; Application -&gt; Qt -&gt; Qt5-based application&#8221;:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/02-qt5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4687\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/02-qt5.png\" alt=\"\" width=\"886\" height=\"693\" \/><\/a><\/li>\n<li>Select a cross-toolchain you would like to use (VisualGDB can download it automatically if you haven&#8217;t installed it yet) and pick your Beaglebone connection in the &#8220;Deployment computer&#8221; field:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/03-toolchain-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4688\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/03-toolchain-1.png\" alt=\"\" width=\"886\" height=\"693\" \/><\/a><\/li>\n<li>Press &#8220;Finish&#8221; to generate the project. VisualGDB will automatically install the Qt packages on the Beaglebone and will then suggest synchronizing the toolchain sysroot in order to support cross-compiling Qt applications:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/04-sync.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4689\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/04-sync.png\" alt=\"\" width=\"886\" height=\"693\" \/><\/a><\/li>\n<li>Ensure synchronization completes without errors (warnings due to unreadable private SSL keys are normal) and close the synchronization window:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/05-synced.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4690\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/05-synced.png\" alt=\"\" width=\"786\" height=\"443\" \/><\/a><\/li>\n<li>Once the project is created, build it by pressing Ctrl-Shift-B:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/06-built.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4691\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/06-built.png\" alt=\"\" width=\"1268\" height=\"806\" \/><\/a><\/li>\n<li>Now you can start debugging the project by pressing F5. Note that if you are using an IoT SD card image (that does not include an X server), the application will fail to start:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/07-display.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4692\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/07-display.png\" alt=\"\" width=\"1268\" height=\"806\" \/><\/a><\/li>\n<li>To fix this, connect to the target via SSH and install the &#8220;xserver-xorg&#8221; package:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/08-getxorg.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4693\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/08-getxorg.png\" alt=\"\" width=\"1275\" height=\"750\" \/><\/a><\/li>\n<li>Now you can start debugging again. This time the project will launch successfully and its GUI running on Beaglebone will be automatically displayed on the Windows side via SSH X11 forwarding:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/09-forwarded.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4694\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/09-forwarded.png\" alt=\"\" width=\"1268\" height=\"806\" \/><\/a><\/li>\n<li>You can also configure VisualGDB to display the X11 GUI directly via the Beaglebone&#8217;s HDMI output:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/09\/10-direct.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4696\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/09\/10-direct.png\" alt=\"\" width=\"1175\" height=\"753\" \/><\/a><br \/>\nNote that for this option to work, the same user that is used for SSH connection needs to be logged on to the Beaglebone.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to cross-compile a simple Qt5 application for the Beaglebone Black board running Debian using Visual Studio<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[34,72,33,46],"_links":{"self":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/1088"}],"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=1088"}],"version-history":[{"count":6,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/1088\/revisions"}],"predecessor-version":[{"id":4697,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/1088\/revisions\/4697"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=1088"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=1088"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=1088"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}