gpt4 book ai didi

c++ - g++ 编译器 : compilation terminated

转载 作者:太空狗 更新时间:2023-10-29 21:39:42 24 4
gpt4 key购买 nike

<分区>

我有一个非常简单的程序:

// hello.cpp
#include <iostream>

using namespace std;

int main() {
cout << "Hello, world!" << endl;
return 0;
}

当我使用命令提示符 (Windows) 并键入:

g++ -o hello hello.cpp

我遇到了这个错误:

In file included from /usr/include/wchar.h:6:0,
from /usr/lib/gcc/x86_64-pc-cygwin/4.9.2/include/c++/cwchar:44,

from /usr/lib/gcc/x86_64-pc-cygwin/4.9.2/include/c++/bits/posty pes.h:40,
from /usr/lib/gcc/x86_64-pc-cygwin/4.9.2/include/c++/iosfwd:40,

from /usr/lib/gcc/x86_64-pc-cygwin/4.9.2/include/c++/ios:38,
from /usr/lib/gcc/x86_64-pc-cygwin/4.9.2/include/c++/ostream:38 ,
from /usr/lib/gcc/x86_64-pc-cygwin/4.9.2/include/c++/iostream:3 9,
from hello.cpp:2: /usr/include/sys/reent.h:14:20: fatal error: stddef.h: No such file or directory

#include <stddef.h>
^ compilation terminated.

谁能解决这个问题?我尝试 gcc,一切正常。似乎 g++ 有一些问题。我的g++版本是4.9.2

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