Configure C ++ 11 in eclipse -- ubuntu 12.04

Source: Internet
Author: User

Install g ++ 4.8 sudo apt-get install python-software-properties
Sudo add-apt-repository ppa: ubuntu-toolchain-r/test
Sudo apt-get update
Sudo apt-get install g ++-4.8
Sudo update-alternatives -- install/usr/bin/g ++-4.8 50
Finally, check the version number of g ++ to see if the installation is successful.
Configure global compilation parameters: Select eclipse toolbar Project> Properties> C/C ++ Build> Settings> Miscellaneous. add-std = c ++ 11 to Other flags on the right, right-click the target project and choose Properties> C/C ++ Build> Settings> Miscellaneous. add-std = c ++ 11 to Other flags on the right to configure the indexer of eclipse CDT. It is convenient for the editor to correctly parse the keywords and symbols of C ++ 11.

Select eclipse toolbar Project-> Properties-> C/C ++ General-> Preprocessor Include Paths, Macros etc .:

  1. Select the tab "Providers"
  2. Select Debug in the Configuration column ("Release" can be configured later ")
  3. On the "Providers" tab, select "cdt gcc Built-in Compiler Settings ".
  4. Uncheck Use global provider shared between projects.
  5. Add "-std = c ++ 11" (without quotation marks) to the Command to get compiler specs column );
  6. Select apply and OK.
  7. Finally re-build C/C ++ indexer. Project-> C/C ++ Index-> Rebuild. reference article http://askubuntu.com/questions/271388/how-to-install-gcc-4-8-in-ubuntu-12-04-from-the-terminalhttps://gist.github.com/omnus/6404505http://stackoverflow.com/a/17499266http://stackoverflow.com/a/15321753

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.