简体   繁体   English

使用CL在Windows上构建C ++程序(VS Build Tool Compiler)

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

I try to build program from command line with CL. 我尝试使用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 C:\\ Program Files(x86)\\ Microsoft Visual Studio \\ 2017 \\ BuildTools \\ VC \\ Tools \\ MSVC \\ 14.16.27023 \\ include \\ crtdefs.h(10):致命错误C1083:...... corecrt.h:没有相应的文件和目录

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. 我尝试了VS ouptup中的所有标志,例如/ nologo / TP / DWIN32 / D_WINDOWS / W3 / GR / EHsc / MDd / Zi / Ob0 / Od / RTC1 / showIncludes,但它不起作用。

I need sample of command, what can ignore UniversalCRT, or instruction how fix path. 我需要命令示例,可以忽略UniversalCRT的示例或指示如何修复路径的示例。 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! 我想用corecrt.h添加include dir,但是经典位置C:\\ Program Files(x86)\\ Microsoft SDKs \\ Windows Kits \\ 10 \\ includes不存在!

Install Windows SDK. 安装Windows SDK。

Run the VS2017 installer again, and select it (or plainly select the full C++ dev package). 再次运行VS2017安装程序,然后选择它(或完全选择完整的C ++开发包)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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