{"id":72,"date":"2014-02-04T17:39:31","date_gmt":"2014-02-04T17:39:31","guid":{"rendered":"http:\/\/visualgdb.com\/w\/?p=72"},"modified":"2014-02-04T17:39:31","modified_gmt":"2014-02-04T17:39:31","slug":"cygwin","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/tutorials\/cygwin\/","title":{"rendered":"Using Visual Studio to debug Cygwin applications"},"content":{"rendered":"\n<p>This tutorial shows how to create, build and debug cygwin-based applications with Visual Studio.<\/p>\n<p>Before you begin, please install <a href=\"http:\/\/cygwin.com\/\"> cygwin<\/a> and <a href=\"\/download\"> VisualGDB<\/a> .<\/p>\n<ol>\n<li>Start Visual Studio. Select File-&gt;New project-&gt;VisualGDB-&gt;MinGW\/Cygwin Project Wizard<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/cygwin\/01-newprj.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/cygwin\/01-newprj.png\" alt=\"01-newprj\" width=\"700\" height=\"394\" \/><\/a>Select project location and enter a project name. Then click &#8216;OK&#8217;.<\/li>\n<li>Make sure that &#8220;Create a new project&#8221; is selected and click on &#8216;Next&#8217;.<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/cygwin\/03-newprj.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/cygwin\/03-newprj.png\" alt=\"03-newprj\" width=\"690\" height=\"616\" \/><\/a><\/li>\n<li>On the toolchain page select &#8220;Cygwin&#8221;. VisualGDB will detect its location automatically or you can also select the installation directory manually. Click on &#8216;Finish&#8217;.<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/cygwin\/04-cygwin.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/cygwin\/04-cygwin.png\" alt=\"04-cygwin\" width=\"690\" height=\"616\" \/><\/a><\/li>\n<li>The wizard will generate a Visual Studio project for a simple &#8220;Hello, World&#8221; application built with cygwin tools. To build it just select <strong>Build-&gt;Build Solution<\/strong> or press <strong>Ctrl+Shift+B<\/strong>.<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/cygwin\/08-build.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/cygwin\/08-build.png\" alt=\"08-build\" width=\"700\" height=\"575\" \/><\/a><\/li>\n<li>Set a breakpoint on the cout line and start debugging by selecting <strong>Debug-&gt;Start Debugging<\/strong> or pressing <strong>F5<\/strong>. Debugging your cygwin-based app with VisualGDB is not much different from debugging normal Windows applications: stepping, watch windows, call stack, memory view and many other features will work as usual. VisualGDB will seamlessly control the GDB debugger on behalf of Visual Studio. You can also enter GDB commands directly in the GDB Session window.<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/cygwin\/10-debug.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/cygwin\/10-debug.png\" alt=\"10-debug\" width=\"700\" height=\"575\" \/><\/a>To end debugging, press Shift+F5.<\/li>\n<li>You can always customize the properties of your project by right-clicking at it in Solution Explorer and selecting &#8220;VisualGDB Project Properties&#8221;.<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/cygwin\/11-props.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/cygwin\/11-props.png\" alt=\"11-props\" width=\"700\" height=\"574\" \/><\/a><\/li>\n<li>From the properties window you can control build and debug command lines and many advanced parameters.<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/cygwin\/12-settings.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/cygwin\/12-settings.png\" alt=\"12-settings\" width=\"696\" height=\"605\" \/><\/a><\/li>\n<\/ol>\n<p><\/root><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to create, build and debug cygwin-based applications with Visual Studio. Before you begin, please install cygwin<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[37,36],"_links":{"self":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/72"}],"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=72"}],"version-history":[{"count":0,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/72\/revisions"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=72"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=72"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=72"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}