简体   繁体   中英

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

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

CL -I"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" C:\dev\projects\console-interaction-tester\main.cpp

And I caught error:

C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\include\\crtdefs.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 SDKs\\Windows Kits\\10\\includes doesn't exists!

Install Windows SDK.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM