gpt4 book ai didi

c++ - 需要帮助在 Windows 上正确设置 CLANG

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:21:35 26 4
gpt4 key购买 nike

我需要一些帮助才能在 Windows 上正确设置 clang。

我安装了 Visual Studios 2015。和 Windows SDK。我最近安装了 Clang,并通过它运行了一个非常基本的 hello world 以确保它正常工作。它给了我一个我无法理解的错误。

Visual Studios 会处理得很好。

这是我从 clang 收到的错误输出:

Microsoft Windows [Version 10.0.14393]

C:\Users\Leo>cd C:\Users\Leo\Desktop\Sandbox

C:\Users\Leo\Desktop\Sandbox>clang++ hello.cpp
In file include d from hello.cpp:1:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\iostream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\istream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ostream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ios:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocnum:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\climits:5:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\yvals.h:8:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\crtdefs.h:10:10: fatal error:
'corecrt.h' file not found
#include <corecrt.h>
^
1 error generated.

C:\Users\Leo\Desktop\Sandbox>

hello.cpp 中的第 1 行只是:

#include <iostream>

所以这个错误对我来说没有意义。

最佳答案

在命令提示符下键入 echo %INCLUDE%。查看您的 INCLUDE 路径。

检查以确保您的 INCLUDE 环境变量未设置为包含 Visual Studio 路径的路径。可能还需要对 LIB 环境变量执行相同的操作。

关于c++ - 需要帮助在 Windows 上正确设置 CLANG,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40815915/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com