Getting an error when I enable c++14 features
Posted: Mon May 13, 2019 12:12 am
If I enable c++14 features I keep getting an error and it wont compile.
I go here... Right click on ProjectFolder > Settings > Global Settings > C++ Compiler Options
(I check the flags "Enable all compiler warnings [-Wall], and the flag Enable C++14 Features)
Then when i try to compile it fails and gives me this info in the build log...
C:\Windows\system32\cmd.exe /C C:/MinGW/bin/mingw32-make.exe -j8 SHELL=cmd.exe -e -f Makefile
"----------Building project:[ Project_1 - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'C:/Users/open/Desktop/Sams_teach_yourself_c++/Sams_tutorials/Project_1'
C:/MinGW/bin/g++.exe -c "C:/Users/open/Desktop/Sams_teach_yourself_c++/Sams_tutorials/Project_1/main.cpp" -std=c++14 -Wall -g -O0 -Wall -o ./Debug/main.cpp.o -I. -I.
In file included from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\cstdio:42,
from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\ext\string_conversions.h:43,
from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\bits\basic_string.h:6391,
from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\string:52,
from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\bits\locale_classes.h:40,
from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\bits\ios_base.h:41,
from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\ios:42,
from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\ostream:38,
from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\iostream:39,
from C:/Users/open/Desktop/Sams_teach_yourself_c++/Sams_tutorials/Project_1/main.cpp:1:
c:\mingw\include\stdio.h:788:34: error: '__off64_t' does not name a type; did you mean '__time64_t'?
typedef union { __int64 __value; __off64_t __offset; } fpos_t;
^~~~~~~~~
__time64_t
mingw32-make.exe[1]: *** [Debug/main.cpp.o] Error 1
mingw32-make.exe: *** [All] Error 2
Project_1.mk:97: recipe for target 'Debug/main.cpp.o' failed
mingw32-make.exe[1]: Leaving directory 'C:/Users/open/Desktop/Sams_teach_yourself_c++/Sams_tutorials/Project_1'
Makefile:4: recipe for target 'All' failed
====1 errors, 0 warnings====
I go here... Right click on ProjectFolder > Settings > Global Settings > C++ Compiler Options
(I check the flags "Enable all compiler warnings [-Wall], and the flag Enable C++14 Features)
Then when i try to compile it fails and gives me this info in the build log...
C:\Windows\system32\cmd.exe /C C:/MinGW/bin/mingw32-make.exe -j8 SHELL=cmd.exe -e -f Makefile
"----------Building project:[ Project_1 - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'C:/Users/open/Desktop/Sams_teach_yourself_c++/Sams_tutorials/Project_1'
C:/MinGW/bin/g++.exe -c "C:/Users/open/Desktop/Sams_teach_yourself_c++/Sams_tutorials/Project_1/main.cpp" -std=c++14 -Wall -g -O0 -Wall -o ./Debug/main.cpp.o -I. -I.
In file included from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\cstdio:42,
from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\ext\string_conversions.h:43,
from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\bits\basic_string.h:6391,
from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\string:52,
from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\bits\locale_classes.h:40,
from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\bits\ios_base.h:41,
from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\ios:42,
from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\ostream:38,
from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\iostream:39,
from C:/Users/open/Desktop/Sams_teach_yourself_c++/Sams_tutorials/Project_1/main.cpp:1:
c:\mingw\include\stdio.h:788:34: error: '__off64_t' does not name a type; did you mean '__time64_t'?
typedef union { __int64 __value; __off64_t __offset; } fpos_t;
^~~~~~~~~
__time64_t
mingw32-make.exe[1]: *** [Debug/main.cpp.o] Error 1
mingw32-make.exe: *** [All] Error 2
Project_1.mk:97: recipe for target 'Debug/main.cpp.o' failed
mingw32-make.exe[1]: Leaving directory 'C:/Users/open/Desktop/Sams_teach_yourself_c++/Sams_tutorials/Project_1'
Makefile:4: recipe for target 'All' failed
====1 errors, 0 warnings====