{"id":14355,"date":"2017-04-14T17:56:04","date_gmt":"2017-04-15T01:56:04","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/?p=14355"},"modified":"2021-01-05T10:10:10","modified_gmt":"2021-01-05T10:10:10","slug":"bring-your-existing-c-linux-projects-to-visual-studio","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/bring-your-existing-c-linux-projects-to-visual-studio\/","title":{"rendered":"Bring your existing C++ Linux projects to Visual Studio"},"content":{"rendered":"<p>Visual Studio supports targeting Linux out of the box \u2013 you can edit, remote build and remote debug to a Linux machine (whether that\u2019s a remote machine, a VM running locally or in the cloud, or <a href=\"https:\/\/msdn.microsoft.com\/en-us\/commandline\/wsl\/about\">WSL in Windows 10<\/a>).<\/p>\n<p>This article covers the high-level steps to bring your existing Linux projects to Visual Studio. You can read about other C++ project types in the guide for <a href=\"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2017\/04\/14\/bring-your-cpp-code-to-visual-studio\/\">Bringing your C++ code to Visual Studio<\/a>.<\/p>\n<p><strong>Step 1. Install:<\/strong> Just make sure that you select the C++ Linux workload as part of the VS installation.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-14405\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/bringcode-linux-install.png\" alt=\"bringcode-linux-install\" width=\"449\" height=\"93\" \/><\/p>\n<p><strong>Step 2. Generate VS project:<\/strong> The next step is to <a href=\"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2016\/03\/30\/visual-c-for-linux-development\/#makefile\">create a VS Linux makefile project<\/a><\/p>\n<pre class=\"prettyprint disable-colors\">$ .\/genvcxproj.sh ~\/repos\/preciouscode\/ preciouscode.vcxproj Z:<\/pre>\n<p><strong>Step 3. Configure VS project properties:<\/strong> You will need to specify in Project Properties (right click on project in Solution Explorer) &gt; Remote Build &gt; Build Command Line the exact command you use on your Linux machine to build the sources. In addition, you will want to <a href=\"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2016\/03\/30\/visual-c-for-linux-development\/#includes\">specify the additional include path that VS IntelliSense<\/a> can use to properly aid when editing the code.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-14407\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/bringcode-linux-propertypages.png\" alt=\"bringcode-linux-propertypages\" width=\"853\" height=\"611\" \/><\/p>\n<p>After these steps, you will be able to edit and browse your C++ code, build and debug remotely.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-large wp-image-14415\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/bringcode-linux-debug1-1024x543.png\" alt=\"bringcode-linux-debug\" width=\"879\" height=\"466\" \/><\/p>\n<h3>What\u2019s next<\/h3>\n<p>Follow the links to learn more about <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/linux-development-with-c-in-visual-studio\/\">Visual C++ for Linux development<\/a> and <a href=\"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2017\/02\/08\/targeting-windows-subsystem-for-linux-from-visual-studio\/\">Targeting the Windows Subsystem for Linux from Visual Studio<\/a>.<\/p>\n<p>If you\u2019re new to Visual Studio, learn more by reading the <a href=\"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2017\/04\/21\/getting-started-with-visual-studio-for-c-and-cpp-development\/\">Getting Started with Visual Studio for C and C++ Developers<\/a> topic and the rest of the posts in this <a href=\"https:\/\/blogs.msdn.microsoft.com\/vcblog\/category\/new-user\/\">Getting Started series aimed at C++ users that are new to Visual Studio<\/a>. <a href=\"https:\/\/aka.ms\/vs2017cpp\">Download Visual Studio 2017<\/a> today, try it out and <a href=\"https:\/\/docs.microsoft.com\/en-us\/visualstudio\/ide\/how-to-report-a-problem-with-visual-studio-2017\">share your feedback<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Visual Studio supports targeting Linux out of the box \u2013 you can edit, remote build and remote debug to a Linux machine (whether that\u2019s a remote machine, a VM running locally or in the cloud, or WSL in Windows 10). This article covers the high-level steps to bring your existing Linux projects to Visual Studio. [&hellip;]<\/p>\n","protected":false},"author":308,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[280],"tags":[],"class_list":["post-14355","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-new-user"],"acf":[],"blog_post_summary":"<p>Visual Studio supports targeting Linux out of the box \u2013 you can edit, remote build and remote debug to a Linux machine (whether that\u2019s a remote machine, a VM running locally or in the cloud, or WSL in Windows 10). This article covers the high-level steps to bring your existing Linux projects to Visual Studio. [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/14355","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/308"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=14355"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/14355\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/35994"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=14355"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=14355"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=14355"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}