Build C++ program on Windows with CL (VS Build Tool Compiler)












0















I try to build program from command line with CL.
Run next command:



CL -I"C:Program Files (x86)Microsoft Visual Studio2017BuildToolsVCToolsMSVC14.16.27023include" C:devprojectsconsole-interaction-testermain.cpp


And I caught error:




C:Program Files (x86)Microsoft Visual Studio2017BuildToolsVCToolsMSVC14.16.27023includecrtdefs.h(10): fatal error C1083: ...... corecrt.h: No such file or directory




I tried all flags from VS ouptup, like /nologo /TP /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MDd /Zi /Ob0 /Od /RTC1 /showIncludes but it doesn't work.



I need sample of command, what can ignore UniversalCRT, or instruction how fix path. I wanted to add includes dir with corecrt.h but classic location C:Program Files (x86)Microsoft SDKsWindows Kits10includes doesn't exists!










share|improve this question





























    0















    I try to build program from command line with CL.
    Run next command:



    CL -I"C:Program Files (x86)Microsoft Visual Studio2017BuildToolsVCToolsMSVC14.16.27023include" C:devprojectsconsole-interaction-testermain.cpp


    And I caught error:




    C:Program Files (x86)Microsoft Visual Studio2017BuildToolsVCToolsMSVC14.16.27023includecrtdefs.h(10): fatal error C1083: ...... corecrt.h: No such file or directory




    I tried all flags from VS ouptup, like /nologo /TP /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MDd /Zi /Ob0 /Od /RTC1 /showIncludes but it doesn't work.



    I need sample of command, what can ignore UniversalCRT, or instruction how fix path. I wanted to add includes dir with corecrt.h but classic location C:Program Files (x86)Microsoft SDKsWindows Kits10includes doesn't exists!










    share|improve this question



























      0












      0








      0








      I try to build program from command line with CL.
      Run next command:



      CL -I"C:Program Files (x86)Microsoft Visual Studio2017BuildToolsVCToolsMSVC14.16.27023include" C:devprojectsconsole-interaction-testermain.cpp


      And I caught error:




      C:Program Files (x86)Microsoft Visual Studio2017BuildToolsVCToolsMSVC14.16.27023includecrtdefs.h(10): fatal error C1083: ...... corecrt.h: No such file or directory




      I tried all flags from VS ouptup, like /nologo /TP /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MDd /Zi /Ob0 /Od /RTC1 /showIncludes but it doesn't work.



      I need sample of command, what can ignore UniversalCRT, or instruction how fix path. I wanted to add includes dir with corecrt.h but classic location C:Program Files (x86)Microsoft SDKsWindows Kits10includes doesn't exists!










      share|improve this question
















      I try to build program from command line with CL.
      Run next command:



      CL -I"C:Program Files (x86)Microsoft Visual Studio2017BuildToolsVCToolsMSVC14.16.27023include" C:devprojectsconsole-interaction-testermain.cpp


      And I caught error:




      C:Program Files (x86)Microsoft Visual Studio2017BuildToolsVCToolsMSVC14.16.27023includecrtdefs.h(10): fatal error C1083: ...... corecrt.h: No such file or directory




      I tried all flags from VS ouptup, like /nologo /TP /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MDd /Zi /Ob0 /Od /RTC1 /showIncludes but it doesn't work.



      I need sample of command, what can ignore UniversalCRT, or instruction how fix path. I wanted to add includes dir with corecrt.h but classic location C:Program Files (x86)Microsoft SDKsWindows Kits10includes doesn't exists!







      c++ cmake msbuild cl






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 16 '18 at 7:46









      Alex

      656411




      656411










      asked Nov 15 '18 at 10:49









      GFBGFB

      11629




      11629
























          1 Answer
          1






          active

          oldest

          votes


















          1














          Install Windows SDK.



          Run the VS2017 installer again, and select it (or plainly select the full C++ dev package).






          share|improve this answer
























          • Is this only way? Have I install 16 Gb of sowf to compile little C++ program?

            – GFB
            Nov 15 '18 at 13:10











          • If smb interested, I installed another components for C++ dev and write bat file for build. Solution here: github.com/goforbroke1006/console-interaction-tester/blob/…

            – GFB
            Nov 15 '18 at 13:12













          • Yes, it's the only way. You don't have to have the full package, then you have to go an look for the Windows SDK inside the individual models.

            – Matthieu Brucher
            Nov 15 '18 at 13:24











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53317744%2fbuild-c-program-on-windows-with-cl-vs-build-tool-compiler%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          Install Windows SDK.



          Run the VS2017 installer again, and select it (or plainly select the full C++ dev package).






          share|improve this answer
























          • Is this only way? Have I install 16 Gb of sowf to compile little C++ program?

            – GFB
            Nov 15 '18 at 13:10











          • If smb interested, I installed another components for C++ dev and write bat file for build. Solution here: github.com/goforbroke1006/console-interaction-tester/blob/…

            – GFB
            Nov 15 '18 at 13:12













          • Yes, it's the only way. You don't have to have the full package, then you have to go an look for the Windows SDK inside the individual models.

            – Matthieu Brucher
            Nov 15 '18 at 13:24
















          1














          Install Windows SDK.



          Run the VS2017 installer again, and select it (or plainly select the full C++ dev package).






          share|improve this answer
























          • Is this only way? Have I install 16 Gb of sowf to compile little C++ program?

            – GFB
            Nov 15 '18 at 13:10











          • If smb interested, I installed another components for C++ dev and write bat file for build. Solution here: github.com/goforbroke1006/console-interaction-tester/blob/…

            – GFB
            Nov 15 '18 at 13:12













          • Yes, it's the only way. You don't have to have the full package, then you have to go an look for the Windows SDK inside the individual models.

            – Matthieu Brucher
            Nov 15 '18 at 13:24














          1












          1








          1







          Install Windows SDK.



          Run the VS2017 installer again, and select it (or plainly select the full C++ dev package).






          share|improve this answer













          Install Windows SDK.



          Run the VS2017 installer again, and select it (or plainly select the full C++ dev package).







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 15 '18 at 10:58









          Matthieu BrucherMatthieu Brucher

          16.3k32143




          16.3k32143













          • Is this only way? Have I install 16 Gb of sowf to compile little C++ program?

            – GFB
            Nov 15 '18 at 13:10











          • If smb interested, I installed another components for C++ dev and write bat file for build. Solution here: github.com/goforbroke1006/console-interaction-tester/blob/…

            – GFB
            Nov 15 '18 at 13:12













          • Yes, it's the only way. You don't have to have the full package, then you have to go an look for the Windows SDK inside the individual models.

            – Matthieu Brucher
            Nov 15 '18 at 13:24



















          • Is this only way? Have I install 16 Gb of sowf to compile little C++ program?

            – GFB
            Nov 15 '18 at 13:10











          • If smb interested, I installed another components for C++ dev and write bat file for build. Solution here: github.com/goforbroke1006/console-interaction-tester/blob/…

            – GFB
            Nov 15 '18 at 13:12













          • Yes, it's the only way. You don't have to have the full package, then you have to go an look for the Windows SDK inside the individual models.

            – Matthieu Brucher
            Nov 15 '18 at 13:24

















          Is this only way? Have I install 16 Gb of sowf to compile little C++ program?

          – GFB
          Nov 15 '18 at 13:10





          Is this only way? Have I install 16 Gb of sowf to compile little C++ program?

          – GFB
          Nov 15 '18 at 13:10













          If smb interested, I installed another components for C++ dev and write bat file for build. Solution here: github.com/goforbroke1006/console-interaction-tester/blob/…

          – GFB
          Nov 15 '18 at 13:12







          If smb interested, I installed another components for C++ dev and write bat file for build. Solution here: github.com/goforbroke1006/console-interaction-tester/blob/…

          – GFB
          Nov 15 '18 at 13:12















          Yes, it's the only way. You don't have to have the full package, then you have to go an look for the Windows SDK inside the individual models.

          – Matthieu Brucher
          Nov 15 '18 at 13:24





          Yes, it's the only way. You don't have to have the full package, then you have to go an look for the Windows SDK inside the individual models.

          – Matthieu Brucher
          Nov 15 '18 at 13:24




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53317744%2fbuild-c-program-on-windows-with-cl-vs-build-tool-compiler%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Xamarin.iOS Cant Deploy on Iphone

          Glorious Revolution

          Dulmage-Mendelsohn matrix decomposition in Python