I have this line written in my code
vector<GLfloat> cone1 { 0.0f, 2.4f, -11.0f, /*rotated*/30.0f, -1.5f, 0.0f, 0.0f };
But the errors comes up like in C++98, variable must be initialized by constructor not by {}
I have searched the solution that I should use -std-c++11, but I don't know how to add this in Eclipse?
Eclipse is popular for Java project development. It also supports C/C++, PHP, Python, Perl, and other web project developments via extensible plug-ins. Eclipse is cross-platform and runs under Windows, Linux and Mac OS.
Launch Eclipse → Help → Install New Software → In "Work with" field, pull down the drop-down menu and select "Kepler - http://download.eclipse.org/releases/kepler" (or juno for Eclipse 4.2; or helios for Eclipse 3.7). In "Name" box, expand "Programming Language" node ⇒ Check "C/C++ Development Tools" ⇒ "Next" ⇒ ...
In Eclipse, go to the "File" menu, then "New", then "Project". Click the "+" sign to expand "C++" to "Managed Make C++ Project" and "Standard Make C++ Project". Choose the former. A dialog box will ask whether to open the C/C++ perspective.
Eclipse CDT uses C/C++ Compiler. Hence before we can start using Eclipse CDT for C/C++ development, we need to have a proper GCC compiler on our system. We can either have 'MinGW' or 'Cygwin' compiler on our machine that will be used by eclipse.
You can do this in a few simple steps...
-std=c++11
Now rebuild your project.
Note: this assumes you did not create your project to use GNU Autotools or a makefile.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With