求助g++的奇怪报错
  • 板块灌水区
  • 楼主__LYY_p
  • 当前回复2
  • 已保存回复2
  • 发布时间2023/7/14 20:51
  • 上次更新2023/11/3 09:49:03
查看原帖
求助g++的奇怪报错
283255
__LYY_p楼主2023/7/14 20:51

这就是传说中的编译器自己报自己错吗

一有iostream头文件就报错

In file included from C:/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/exception_ptr.h:40,
                 from C:/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/exception:143,
                 from C:/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/ios:39,
                 from C:/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/ostream:38,
                 from C:/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/iostream:39,
                 from C:/Users/������/AppData/Local/Temp/CP Editor-CHjdAf/sol.cpp:1:
C:/c++/new:1:1: error: expected unqualified-id before numeric constant
 9 9
 ^
In file included from C:/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/exception:144,
                 from C:/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/ios:39,
                 from C:/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/ostream:38,
                 from C:/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/iostream:39,
                 from C:/Users/������/AppData/Local/Temp/CP Editor-CHjdAf/sol.cpp:1:
C:/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/nested_exception.h:54:5: error: 'exception_ptr' does not name a type; did you mean 'exception'?
     exception_ptr _M_ptr;
     ^~~~~~~~~~~~~
     exception
C:/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/nested_exception.h:74:5: error: 'exception_ptr' does not name a type; did you mean 'exception'?
     exception_ptr
     ^~~~~~~~~~~~~
     exception
C:/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/nested_exception.h: In constructor 'std::nested_exception::nested_exception()':
C:/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/nested_exception.h:57:35: error: class 'std::nested_exception' does not have any field named '_M_ptr'
     nested_exception() noexcept : _M_ptr(current_exception()) { }
                                   ^~~~~~
C:/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/nested_exception.h:57:42: error: 'current_exception' was not declared in this scope
     nested_exception() noexcept : _M_ptr(current_exception()) { }
                                          ^~~~~~~~~~~~~~~~~

底下还有一堆就不放了,报错的都是g++自己的东西,想问问这种情况怎么解决

2023/7/14 20:51
加载中...