首页 > 解决方案 > 错误 C1083:如何修复损坏的 Visual Studio 编译器?

问题描述

我的 Visual Studio 总是无法编译任何 C++ 程序。我没有篡改或修改编译器。

#include <iostream>

int main()
{
    std::cout << "Hello World!\n";
}

给出输出:

1>Program
1>c1xx : fatal error C1083: Cannot open source file: 'C:\Program': No such file or directory
1>Files
1>c1xx : fatal error C1083: Cannot open source file: 'Files': No such file or directory
1>Microsoft
1>c1xx : fatal error C1083: Cannot open source file: '(x86)\Microsoft': No such file or directory
1>Visual
1>c1xx : fatal error C1083: Cannot open source file: 'Visual': No such file or directory
1>x64
1>c1xx : fatal error C1083: Cannot open source file: 'Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64': No such file or directory
1>test.cpp
1>Generating Code...
1>Done building project "test.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

我认为其中一条路径缺少双引号,但我不知道在哪里解决这个问题。

标签: c++visual-studiovisual-c++

解决方案


我建议您可以检查以下路径设置是否正确。

  1. Windows设置->高级系统设置->环境变量->路径->环境变量 在此处输入图像描述

  2. Visual Studio 项目->属性->VC++ 目录->包含目录

在此处输入图像描述

如果它仍然不起作用,您可以重置Environment Variblesin Tools->Import and Export Settings->Reset all settings


推荐阅读