{"id":5233,"date":"2007-12-31T00:34:00","date_gmt":"2007-12-31T00:34:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2007\/12\/31\/using-different-toolsets-for-vc-build\/"},"modified":"2019-02-18T18:54:14","modified_gmt":"2019-02-18T18:54:14","slug":"using-different-toolsets-for-vc-build","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/using-different-toolsets-for-vc-build\/","title":{"rendered":"Using different toolsets for vc build"},"content":{"rendered":"<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">Hi,<\/font><\/p>\n<p class=\"MsoNormal\">&nbsp;<\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\">I am Olga Arkhipova and I am a VC IDE developer. I joined VC team about two years ago and inherited vc project and build system. &nbsp;I&rsquo;ve been using VC since VC2, so for me it is quite interesting to see and work on the code I&rsquo;ve been using (or sometimes not using, because it did not do what I needed) for so long <\/font><span>J<\/span><\/font><\/p>\n<p class=\"MsoNormal\">\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">As VS9 has now shipped together with new compilers and libraries, several people inside Microsoft asked me how vc build finds its build tools (cl, link, different libraries and includes) and if it is possible to use a different VC toolset rather than those installed with VS (for instance, use vs9 from vs8 and vice versa, or a particular SDK toolset), so I decided it might be useful&nbsp; to blog about this question for other people. Yes, it is possible and the information on how to do this does exist on MSDN, but it appears to be hard to find and it is split into pieces.<\/font><\/p>\n<p class=\"MsoNormal\">\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">To define a <b>toolset for the command line build<\/b> you need to:<\/font><\/p>\n<p class=\"MsoNormal\">\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoListParagraph\"><span><span><font size=\"3\">&middot;<\/font><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><font face=\"Calibri\" size=\"3\">Set INCLUDE, LIB, LIBPATH and PATH environment variables to point to the corresponding directories of the toolset you want to use (LIBPATH is for managed References dirs). Something like<\/font><\/p>\n<p class=\"MsoListParagraph\"><font face=\"Calibri\" size=\"3\">set &nbsp;MyToolSetRoot =c: MyToolSet<\/font><\/p>\n<p class=\"MsoListParagraph\"><font face=\"Calibri\" size=\"3\">set INCLUDE=&#8221;%MyToolSetRoot%include;%MyToolSetRoot%atlmfcinclude;%MyToolSetRoot%SDKinclude;<\/font><\/p>\n<p class=\"MsoListParagraph\">\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoListParagraph\"><span><span><font size=\"3\">&middot;<\/font><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><font face=\"Calibri\" size=\"3\">Run &lsquo;devenv \/useenv&rsquo; or &lsquo;vcbuild \/useenv&rsquo; to force using defined locations instead of standard VS ones.<\/font><\/p>\n<p class=\"MsoNormal\">\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">Note that those directories you set will be used for all platforms, so if you need to build for more than one platform, you&rsquo;ll have to define INCLUDE, LIB, LIBPATH and PATH for each of them and build them separately, say, by running &lsquo;vcbuild \/platform:&lt;str&gt; &hellip;&rsquo; <\/font><\/p>\n<p class=\"MsoNormal\">\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">To see what VS9 (and I believe VS8) sets for different platforms, you can take a look at<\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">c:Program FilesMicrosoft Visual Studio 9.0VCbinvsvars32.bat<\/font><\/p>\n<p class=\"MsoNormal\">\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">And if you installed 64-bit platform support:<\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">c:Program FilesMicrosoft Visual Studio 9.0VCbinx86_ia64vcvarsx86_ia64.bat &nbsp;&nbsp;(cross platform tools)<\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">c:Program FilesMicrosoft Visual Studio 9.0VCbinx86_amd64vcvarsx86_amd64.bat (cross platform tools)<\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">c:Program FilesMicrosoft Visual Studio 9.0VCbinia64vcvarsia64.bat ( native 64-bit tools, installs only on 64bit OS)<\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">c:Program FilesMicrosoft Visual Studio 9.0VCbinamd64vcvarsamd64.bat ( native 64-bit tools, installs only on 64bit OS)<\/font><\/p>\n<p class=\"MsoNormal\">\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoNormal\">\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">You can also change the vc build <b>toolset for the VS IDE<\/b>. <\/font><\/p>\n<p class=\"MsoNormal\">\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">Start VS,&nbsp; go to Tools &ndash; Options &#8211; Projects and Solutions &#8211; VC++ Directories&nbsp; and modify directories for &lsquo;Executable files&rsquo;, &lsquo;Include files&rsquo;, &lsquo;Library files&rsquo; and &lsquo;Reference files&rsquo; to point to your toolset directories. You can use environment variables as macros there. For instance, if you have &lsquo;MyToolSetRoot&rsquo; environment variable defined on your machine, for &lsquo;Include files&rsquo; you can set:<\/font><\/p>\n<p class=\"MsoNormal\">\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoListParagraph\"><font face=\"Calibri\" size=\"3\">$( MyToolSetRoot)include<\/font><\/p>\n<p class=\"MsoListParagraph\"><font face=\"Calibri\" size=\"3\">$( MyToolSetRoot)atlmfcinclude<\/font><\/p>\n<p class=\"MsoListParagraph\"><font face=\"Calibri\" size=\"3\">$( MyToolSetRoot)SDKinclude<\/font><\/p>\n<p class=\"MsoNormal\">\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">Do this for all platforms you build for. Close the dialog. These will modify the options per user\/per machine. If you want to switch between different VC directories on your machine or share them to another machine, in VS9 and VS8(sp1) you can use Tools &#8211; Import\/Export settings (VS8 does not support this). The VC++ directories are not imported\/exported by default (as they might contain only this machine specific directories), so you need to check &nbsp;All Settings &ndash; Options &ndash; Projects &ndash; VC++ Directories explicitly.<\/font><\/p>\n<p class=\"MsoNormal\">\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">Thanks,<\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">Olga<\/font><\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, &nbsp; I am Olga Arkhipova and I am a VC IDE developer. I joined VC team about two years ago and inherited vc project and build system. &nbsp;I&rsquo;ve been using VC since VC2, so for me it is quite interesting to see and work on the code I&rsquo;ve been using (or sometimes not using, [&hellip;]<\/p>\n","protected":false},"author":289,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5233","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus"],"acf":[],"blog_post_summary":"<p>Hi, &nbsp; I am Olga Arkhipova and I am a VC IDE developer. I joined VC team about two years ago and inherited vc project and build system. &nbsp;I&rsquo;ve been using VC since VC2, so for me it is quite interesting to see and work on the code I&rsquo;ve been using (or sometimes not using, [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/5233","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\/289"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=5233"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/5233\/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=5233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=5233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=5233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}