gpt4 book ai didi

c++ - 编译c++程序时的 fatal error

转载 作者:太空宇宙 更新时间:2023-11-04 13:09:48 25 4
gpt4 key购买 nike

我正在为 C++ 使用 eclipse kepler,在编译一个简单的 hello world 程序时我看到了这个错误。

c:\mingw\include\_mingw.h:73:20: fatal error: w32api.h: No such file or directory

而整个窗口如下所示。

09:15:59 **** Incremental Build of configuration Debug for project project1 ****
Info: Internal Builder is used for build
g++ "-IC:\\MinGW\\lib\\gcc\\mingw32\\5.3.0\\include\\c++" "-IC:\\MinGW\\lib\\gcc\\mingw32\\5.3.0\\include\\c++\\backward" "-IC:\\MinGW\\lib\\gcc\\mingw32\\5.3.0\\include" "-IC:\\MinGW\\lib\\gcc\\mingw32\\5.3.0\\include-fixed" "-IC:\\MinGW\\lib\\gcc\\mingw32\\5.3.0\\include\\c++\\mingw32" "-IC:\\MinGW\\include" -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\project1.o" "..\\src\\project1.cpp"
In file included from c:\mingw\include\wchar.h:53:0,
from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:44,
from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\bits\postypes.h:40,
from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\iosfwd:40,
from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\ios:38,
from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\ostream:38,
from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\iostream:39,
from ..\src\project1.cpp:2:
c:\mingw\include\_mingw.h:73:20: fatal error: w32api.h: No such file or directory
compilation terminated.

09:16:01 Build Finished (took 2s.535ms)

我能做什么?我的代码是这样的

#include <iostream>
using namespace std;
int main()
{
cout<<"hello world";
}

最佳答案

在我的例子中,我是这样解决的:

  1. 转到 MinGW 安装管理器。
  2. 从安装列表中选择“基本设置”并勾选包“mingw32-base-bin”。
  3. 从安装选项卡中选择“应用更改”。

关于c++ - 编译c++程序时的 fatal error ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40446450/

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