I wanted to include array in DEv C++ 5.9 but it gave an error:
32 2 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\bits\c++0x_warning.h [Error] #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
Is this because of the version of DEV-C++ that I am using or my computer IOS? I used other versions of DEV C++ but since I have a windows 8 on my computer, they did not work on that and I needed to use this version of DEV C++. Any help is appreciated.
Thanks
The error message tells you exactly how to fix the error.
#error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be
enabled with the -std=c++11 or -std=gnu++11 compiler options
Read your IDE documentation to figure out how to do this or refer to this image.
http://www.cplusplus.com/doc/tutorial/introduction/devcpp/devcpp2.png
In DEV C++ , tools << set the compiler to debug/release << Setting << Code Generation << Language standard(-std) << ISO C++11 or GCC C++11 (whatever you use) << complie your code of std::array using debug/release whatever you used earlier..
Is this because of the version of DEV-C++ that I am using or my
computer IOS?
No, it depends on the C++ compiler version.
As the error says:
This file requires compiler and library support for the ISO C++ 2011
standard.
Related
I purchased a book recently entitled beginning C++20. I was looking to begin learning c++ though I now realize that I can't find a compiler that can run the code in the book as I get an error since the compiler I'm using (xcode) does not support c++ 20. I'm wondering if there are any compilers that I can run on my mac that support c++20.
gcc version 8 and up supports some of C++20; you can try using that.
It should also be noted that Xcode isn't a compiler, but instead an IDE that should be using clang as the actual compiler. Clang also currently has support for some of the C++ 20 features. To use them the -std=c++20 flag will still be needed.
Here can you find the currently implemented feature support of the GCC compiler of the C++20 specification:
GCC Link
But you need to enable it in your console command or add this to your toolchain: "-std=c++20"
I'm trying to create a native library in C++, which I can use in Android.
I've created a project in Visual Studio 2017: Dynamic Shared Library (Android), and added my cpp code.
Though some of the code is running C++11, and I'd really like to keep it that way.
When I compile, I get the error:
This file requires compiler and library support for the ISO C++ 2011 standard.
This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
So I first tried going to Project->Properties->C/C++->Language->C++ Language Standard, and set the options as following:
'
When I compile now, I get exactly the same error. So I tried manually adding the -std=c++11 flag under additional options, though still getting the error.
Why is the compiler not willing to compile using the ++11 standard, and what can I do to fix this? I know it's experimental, but it should at least try to compile.
Best regards
The problem was solved, when I changed the settings to be for All Platforms, and not just ARM.
I am using OMNET 4.4. When OMNET compiles it says that
this file requires compiler and library support for the ISO c++ 2011 standard. This support is currently experimental and must be enabled with -std=c++11 or -gnu=c++11 compiler options.
Also following error appears:
/veins/modules/application/traci/TraCITestApp.h:78:36: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
I am using windows 10 and I could not find solution to it in internet .
Can anyone help me with some information ?
First, this warning is not coming up from the build of OMNeT++, but from the build of Veins. It is not the same. OMNeT++ 4.4 builds without C++11 support fine, but it seems that recent versions of Veins may need it. However again, this is a warning. OMNeT++ 4.6 and later can be configured with the -std=c++11.
You may need to update your compiler, too as any recent compiler fully supports c++11 since at least 3 years.
I want to use poisson_distribution template in my C++ code (included in random header), but cant find a way to compile it without error
My codeblocks shows an error
This file requires compiler and library support for the \
ISO C++ 2011 standard. This support is currently experimental, and must be \
enabled with the -std=c++11 or -std=gnu++11 compiler options.
I remember while installing codeblocks I installed only gnu c/c++ compiler. Can anyone explain me how to update my compiler to standard ISO C++ 2011 standard or suggest an alternative.
Thanks in advance...
You don't need to update the compiler. You just need to set it to C++11 mode.
How can I add C++11 support to Code::Blocks compiler?
A simple option would be to write
-std=c++11
As part of the other compiler options flags or directly in your Makefile.
Note that some projects may require -std=gnu++11 which is like C++11 but has some GNU extensions enabled.
Settings > Compiler >
select the checkbox:
'Have g++ follow the C++11 ISO C++ language standard'
I've built gcc 4.6.1 for Solaris 8 sparc. I'm compiling some code that uses boost::lexical_cast (boost 1.48) and I get this error:
boost/math/special_functions/sign.hpp: In function 'int boost::math::detail::signbit_impl(T, const boost::math::detail::native_tag&)'
error: 'signbit' is not a member of 'std'
(Also similar errors for fpclassify, isfinite, isnormal, isinf, isnan)
I looked at the cmath header and it defines std::signbit conditionally depending on whether _GLIBCXX_USE_C99_MATH is defined. I ran cpp -dM and I see that _GLIBCXX_USE_C99_MATH is not defined. Is there a way to enable the C99 support? Do I have to rebuild libc or is this platform just too old? I'm out of my element so any guidance on getting this working would be great.
Your platform C library is likely too old to support the C99 FP library additions.
From the Sun Studio 12 User's Guide:
Note - Though the compiler defaults to supporting the features of C99 listed
below, standard headers provided by the Solaris software in /usr/include do
not yet conform with the 1999 ISO/IEC C standard. If error messages are
encountered, try using -xc99=none to obtain the 1990 ISO/IEC C standard
behavior for these headers.