Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm on Windows 10 with MinGW, and recently updated my g++, using mingw-get update and mingw-get upgrade. This error occurred, even after total MinGW reinstall. No Google searches bring up anything remotely related.

I tried compiling

#include <iostream>
int main(){}

which failed with the following:

In file included from c:mingwincludewchar.h:208:0,
                 from c:mingwlibgccmingw324.9.3includec++cwchar:44,
                 from c:mingwlibgccmingw324.9.3includec++itspostypes.h:40,
                 from c:mingwlibgccmingw324.9.3includec++iosfwd:40,
                 from c:mingwlibgccmingw324.9.3includec++ios:38,
                 from c:mingwlibgccmingw324.9.3includec++ostream:38,
                 from c:mingwlibgccmingw324.9.3includec++iostream:39,
                 from ariprog.cpp:8:
c:mingwincludesys/stat.h:173:14: error: '_dev_t' does not name a type
 struct _stat __struct_stat_defined( _off_t, time_t );
              ^
c:mingwincludesys/stat.h:173:14: error: '_ino_t' does not name a type
 struct _stat __struct_stat_defined( _off_t, time_t );
              ^
c:mingwincludesys/stat.h:173:14: error: '_mode_t' does not name a type
 struct _stat __struct_stat_defined( _off_t, time_t );
              ^
c:mingwincludesys/stat.h:173:14: error: '_dev_t' does not name a type
 struct _stat __struct_stat_defined( _off_t, time_t );
              ^
c:mingwincludesys/stat.h:173:14: error: '_off_t' does not name a type
 struct _stat __struct_stat_defined( _off_t, time_t );
              ^
c:mingwincludesys/stat.h:173:14: error: 'time_t' does not name a type
 struct _stat __struct_stat_defined( _off_t, time_t );
              ^
c:mingwincludesys/stat.h:173:14: error: 'time_t' does not name a type
 struct _stat __struct_stat_defined( _off_t, time_t );
              ^
c:mingwincludesys/stat.h:173:14: error: 'time_t' does not name a type
 struct _stat __struct_stat_defined( _off_t, time_t );
              ^
c:mingwincludesys/stat.h:180:13: error: '_dev_t' does not name a type
 struct stat __struct_stat_defined( _off_t, time_t );
             ^
c:mingwincludesys/stat.h:180:13: error: '_ino_t' does not name a type
 struct stat __struct_stat_defined( _off_t, time_t );
             ^
c:mingwincludesys/stat.h:180:13: error: '_mode_t' does not name a type
 struct stat __struct_stat_defined( _off_t, time_t );
             ^
c:mingwincludesys/stat.h:180:13: error: '_dev_t' does not name a type
 struct stat __struct_stat_defined( _off_t, time_t );
             ^
c:mingwincludesys/stat.h:180:13: error: '_off_t' does not name a type
 struct stat __struct_stat_defined( _off_t, time_t );
             ^
c:mingwincludesys/stat.h:180:13: error: 'time_t' does not name a type
 struct stat __struct_stat_defined( _off_t, time_t );
             ^
c:mingwincludesys/stat.h:180:13: error: 'time_t' does not name a type
 struct stat __struct_stat_defined( _off_t, time_t );
             ^
c:mingwincludesys/stat.h:180:13: error: 'time_t' does not name a type
 struct stat __struct_stat_defined( _off_t, time_t );
             ^
c:mingwincludesys/stat.h:188:17: error: '_dev_t' does not name a type
 struct _stati64 __struct_stat_defined( __off64_t, time_t );
                 ^
c:mingwincludesys/stat.h:188:17: error: '_ino_t' does not name a type
 struct _stati64 __struct_stat_defined( __off64_t, time_t );
                 ^
c:mingwincludesys/stat.h:188:17: error: '_mode_t' does not name a type
 struct _stati64 __struct_stat_defined( __off64_t, time_t );
                 ^
c:mingwincludesys/stat.h:188:17: error: '_dev_t' does not name a type
 struct _stati64 __struct_stat_defined( __off64_t, time_t );
                 ^
c:mingwincludesys/stat.h:188:17: error: '__off64_t' does not name a type
 struct _stati64 __struct_stat_defined( __off64_t, time_t );
                 ^
c:mingwincludesys/stat.h:188:17: error: 'time_t' does not name a type
 struct _stati64 __struct_stat_defined( __off64_t, time_t );
                 ^
c:mingwincludesys/stat.h:188:17: error: 'time_t' does not name a type
 struct _stati64 __struct_stat_defined( __off64_t, time_t );
                 ^
c:mingwincludesys/stat.h:188:17: error: 'time_t' does not name a type
 struct _stati64 __struct_stat_defined( __off64_t, time_t );
                 ^
c:mingwincludesys/stat.h:195:17: error: '_dev_t' does not name a type
 struct __stat64 __struct_stat_defined( __off64_t, __time64_t );
                 ^
c:mingwincludesys/stat.h:195:17: error: '_ino_t' does not name a type
 struct __stat64 __struct_stat_defined( __off64_t, __time64_t );
                 ^
c:mingwincludesys/stat.h:195:17: error: '_mode_t' does not name a type
 struct __stat64 __struct_stat_defined( __off64_t, __time64_t );
                 ^
c:mingwincludesys/stat.h:195:17: error: '_dev_t' does not name a type
 struct __stat64 __struct_stat_defined( __off64_t, __time64_t );
                 ^
c:mingwincludesys/stat.h:195:17: error: '__off64_t' does not name a type
 struct __stat64 __struct_stat_defined( __off64_t, __time64_t );
                 ^
c:mingwincludesys/stat.h:195:17: error: '__time64_t' does not name a type
 struct __stat64 __struct_stat_defined( __off64_t, __time64_t );
                 ^
c:mingwincludesys/stat.h:195:17: error: '__time64_t' does not name a type
 struct __stat64 __struct_stat_defined( __off64_t, __time64_t );
                 ^
c:mingwincludesys/stat.h:195:17: error: '__time64_t' does not name a type
 struct __stat64 __struct_stat_defined( __off64_t, __time64_t );
                 ^
In file included from c:mingwincludewchar.h:233:0,
                 from c:mingwlibgccmingw324.9.3includec++cwchar:44,
                 from c:mingwlibgccmingw324.9.3includec++itspostypes.h:40,
                 from c:mingwlibgccmingw324.9.3includec++iosfwd:40,
                 from c:mingwlibgccmingw324.9.3includec++ios:38,
                 from c:mingwlibgccmingw324.9.3includec++ostream:38,
                 from c:mingwlibgccmingw324.9.3includec++iostream:39,
                 from ariprog.cpp:8:
c:mingwincludeio.h:335:21: error: 'time_t' does not name a type
 struct _wfinddata_t __struct_finddata_t (time_t, _fsize_t);
                     ^
c:mingwincludeio.h:335:21: error: 'time_t' does not name a type
 struct _wfinddata_t __struct_finddata_t (time_t, _fsize_t);
                     ^
c:mingwincludeio.h:335:21: error: 'time_t' does not name a type
 struct _wfinddata_t __struct_finddata_t (time_t, _fsize_t);
                     ^
c:mingwincludeio.h:336:24: error: 'time_t' does not name a type
 struct _wfinddatai64_t __struct_finddata_t (time_t, __int64);
                        ^
c:mingwincludeio.h:336:24: error: 'time_t' does not name a type
 struct _wfinddatai64_t __struct_finddata_t (time_t, __int64);
                        ^
c:mingwincludeio.h:336:24: error: 'time_t' does not name a type
 struct _wfinddatai64_t __struct_finddata_t (time_t, __int64);
                        ^
c:mingwincludeio.h:362:24: error: '__time64_t' does not name a type
 struct __wfinddata64_t __struct_finddata_t (__time64_t, __int64);
                        ^
c:mingwincludeio.h:362:24: error: '__time64_t' does not name a type
 struct __wfinddata64_t __struct_finddata_t (__time64_t, __int64);
                        ^
c:mingwincludeio.h:362:24: error: '__time64_t' does not name a type
 struct __wfinddata64_t __struct_finddata_t (__time64_t, __int64);
                        ^
In file included from c:mingwlibgccmingw324.9.3includec++itspostypes.h:40:0,
                 from c:mingwlibgccmingw324.9.3includec++iosfwd:40,
                 from c:mingwlibgccmingw324.9.3includec++ios:38,
                 from c:mingwlibgccmingw324.9.3includec++ostream:38,
                 from c:mingwlibgccmingw324.9.3includec++iostream:39,
                 from ariprog.cpp:8:
c:mingwlibgccmingw324.9.3includec++cwchar:146:11: error: '::fwide' has not been declared
   using ::fwide;
           ^
c:mingwlibgccmingw324.9.3includec++cwchar:153:11: error: '::mbsinit' has not been declared
   using ::mbsinit;
           ^
c:mingwlibgccmingw324.9.3includec++cwchar:164:11: error: '::vfwscanf' has not been declared
   using ::vfwscanf;
           ^
c:mingwlibgccmingw324.9.3includec++cwchar:170:11: error: '::vswscanf' has not been declared
   using ::vswscanf;
           ^
c:mingwlibgccmingw324.9.3includec++cwchar:174:11: error: '::vwscanf' has not been declared
   using ::vwscanf;
           ^
c:mingwlibgccmingw324.9.3includec++cwchar:191:11: error: '::wcstof' has not been declared
   using ::wcstof;
           ^
c:mingwlibgccmingw324.9.3includec++cwchar:198:11: error: '::wmemcmp' has not been declared
   using ::wmemcmp;
           ^
c:mingwlibgccmingw324.9.3includec++cwchar:199:11: error: '::wmemcpy' has not been declared
   using ::wmemcpy;
           ^
c:mingwlibgccmingw324.9.3includec++cwchar:200:11: error: '::wmemmove' has not been declared
   using ::wmemmove;
           ^
c:mingwlibgccmingw324.9.3includec++cwchar:201:11: error: '::wmemset' has not been declared
   using ::wmemset;
           ^
c:mingwlibgccmingw324.9.3includec++cwchar:208:11: error: '::wmemchr' has not been declared
   using ::wmemchr;
           ^
c:mingwlibgccmingw324.9.3includec++cwchar: In function 'wchar_t* std::wmemchr(wchar_t*, wchar_t, std::size_t)':
c:mingwlibgccmingw324.9.3includec++cwchar:229:61: error: invalid conversion from 'const wchar_t*' to 'wchar_t*' [-fpermissive]
   { return wmemchr(const_cast<const wchar_t*>(__p), __c, __n); }
                                                             ^
c:mingwlibgccmingw324.9.3includec++cwchar:228:3: note: initializing argument 1 of 'wchar_t* std::wmemchr(wchar_t*, wchar_t, std::size_t)'
   wmemchr(wchar_t* __p, wchar_t __c, size_t __n)
   ^
c:mingwlibgccmingw324.9.3includec++cwchar: At global scope:
c:mingwlibgccmingw324.9.3includec++cwchar:248:11: error: '::wcstold' has not been declared
   using ::wcstold;
           ^
c:mingwlibgccmingw324.9.3includec++cwchar:257:11: error: '::wcstoll' has not been declared
   using ::wcstoll;
           ^
c:mingwlibgccmingw324.9.3includec++cwchar:258:11: error: '::wcstoull' has not been declared
   using ::wcstoull;
           ^
c:mingwlibgccmingw324.9.3includec++cwchar:264:22: error: '__gnu_cxx::wcstold' has not been declared
   using ::__gnu_cxx::wcstold;
                      ^
c:mingwlibgccmingw324.9.3includec++cwchar:265:22: error: '__gnu_cxx::wcstoll' has not been declared
   using ::__gnu_cxx::wcstoll;
                      ^
c:mingwlibgccmingw324.9.3includec++cwchar:266:22: error: '__gnu_cxx::wcstoull' has not been declared
   using ::__gnu_cxx::wcstoull;
                      ^
c:mingwlibgccmingw324.9.3includec++cwchar:280:14: error: 'std::wcstof' has not been declared
   using std::wcstof;
              ^
c:mingwlibgccmingw324.9.3includec++cwchar:283:14: error: 'std::vfwscanf' has not been declared
   using std::vfwscanf;
              ^
c:mingwlibgccmingw324.9.3includec++cwchar:286:14: error: 'std::vswscanf' has not been declared
   using std::vswscanf;
              ^
c:mingwlibgccmingw324.9.3includec++cwchar:289:14: error: 'std::vwscanf' has not been declared
   using std::vwscanf;
              ^
c:mingwlibgccmingw324.9.3includec++cwchar:293:14: error: 'std::wcstold' has not been declared
   using std::wcstold;
              ^
c:mingwlibgccmingw324.9.3includec++cwchar:294:14: error: 'std::wcstoll' has not been declared
   using std::wcstoll;
              ^
c:mingwlibgccmingw324.9.3includec++cwchar:295:14: error: 'std::wcstoull' has not been declared
   using std::wcstoull;
              ^
In file included from c:mingwlibgccmingw324.9.3includec++ios:40:0,
                 from c:mingwl

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
399 views
Welcome To Ask or Share your Answers For Others

1 Answer

Thanks to @SilencePhil, I found a relevant StackOverflow answer. This question is not the same question, but has the same solution, namely to replace std=c++11 with std=gnu++11 in the call to g++.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...