VS2015 cl Can#39;t find CRT libs (stdio.h, ctype.h etc.) when building on command line(VS2015 cl 在命令行上构建时找不到 CRT 库(stdio.h、ctype.h 等))
问题描述
- 我已经安装了最新的 VS2015 专业版.
- 打开 Visual Studio 命令提示符并运行 vcvars32.bat
- 编写了一个简单的 helloworld.cpp 程序(包括 stdio.h 并打印hello world")
- 试过cl helloworld.cpp
我收到以下错误:
c: est>cl helloworld.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23026 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
helloworld.cpp
helloworld.cpp(1): fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory
vcvars32.bat 设置的包含路径为:
The include paths set by the vcvars32.bat are:
INCLUDE=C:Program Files (x86)Microsoft Visual Studio 14.0VCINCLUDE;C:Program Files (x86)Microsoft Visual Studio 14.0VCATLMFCINCLUDE;C:Program Files (x86)Windows Kits10includewdfucrt;C:Program Files (x86)Windows KitsNETFXSDK4.6includeum;C:Program Files (x86)Windows Kits10includewdfshared;C:Program Files (x86)Windows Kits10includewdfum;C:Program Files (x86)Windows Kits10includewdfwinrt;C:Program Files (x86)Microsoft Visual Studio 14.0VCINCLUDE;C:Program Files (x86)Microsoft Visual Studio 14.0VCATLMFCINCLUDE;C:Program Files (x86)Windows Kits10includewdfucrt;C:Program Files (x86)Windows KitsNETFXSDK4.6includeum;C:Program Files (x86)Windows Kits10includewdfshared;C:Program Files (x86)Windows Kits10includewdfum;C:Program Files (x86)Windows Kits10includewdfwinrt;
注意环境变量中的路径是C:Program Files (x86)Windows Kits10includewdfwinrt;"等.但是,文件的实际位置是C:Program Files (x86)Windows Kits10include10.0.10240.0winrt;
Note that the paths in the environment variable are "C:Program Files (x86)Windows Kits10includewdfwinrt;" etc. However, the actual location of the files is C:Program Files (x86)Windows Kits10include10.0.10240.0winrt;
我在这里做错了吗?非常感谢任何帮助.
Am I doing something wrong here? Any help greatly appreciated.
ps.我的真正目的是构建 boost 1.58 库(但它遇到与上述相同的问题,所以首先想隔离问题).
p.p.s.我注意到以下环境变量.但我无法更改它们.
WindowsSDKLibVersion=wdf
WindowsSDKVersion=wdf
推荐答案
如果您安装了 WDK (Windows Driver Kit - 10.0.26639),您将遇到此问题,因为 WDK 会覆盖包含路径.要使其正常工作,您必须卸载 WDK,它应该可以正常工作.
If you have WDK (Windows Driver Kit - 10.0.26639) installed you will encounter this issue as the include paths are overwritten by the WDK. To get this to work, you must uninstall the WDK and it should work.
查看 Microsoft Connect 问题 - https://connect.microsoft.com/VisualStudio/feedback/details/1610302/universalcrt-detection-breaks-when-windows-driver-kit-is-installed
Take a look at the Microsoft Connect issue - https://connect.microsoft.com/VisualStudio/feedback/details/1610302/universalcrt-detection-breaks-when-windows-driver-kit-is-installed
这篇关于VS2015 cl 在命令行上构建时找不到 CRT 库(stdio.h、ctype.h 等)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:VS2015 cl 在命令行上构建时找不到 CRT 库(stdio.h、ctype.h 等)
基础教程推荐
- 为什么语句不能出现在命名空间范围内? 2021-01-01
- 如何“在 Finder 中显示"或“在资源管理器中显 2021-01-01
- 如何在不破坏 vtbl 的情况下做相当于 memset(this, ...) 的操作? 2022-01-01
- Windows Media Foundation 录制音频 2021-01-01
- 从 std::cin 读取密码 2021-01-01
- 管理共享内存应该分配多少内存?(助推) 2022-12-07
- 使用从字符串中提取的参数调用函数 2022-01-01
- 为 C/C++ 中的项目的 makefile 生成依赖项 2022-01-01
- 在 C++ 中循环遍历所有 Lua 全局变量 2021-01-01
- 如何使图像调整大小以在 Qt 中缩放? 2021-01-01