Home > Backend Development > C++ > How do I enable C 11 support in the Eclipse CDT indexer?

How do I enable C 11 support in the Eclipse CDT indexer?

Barbara Streisand
Release: 2024-11-10 11:25:02
Original
687 people have browsed it

How do I enable C  11 support in the Eclipse CDT indexer?

Enabling C 11 Support in Eclipse CDT Indexer

The Eclipse CDT indexer, responsible for identifying errors prior to compilation, requires specific settings to support the C 11 standard. This article explores the steps to enable C 11 support in Eclipse CDT for Juno, Kepler, and Luna versions.

Indexer Configuration

To modify the Eclipse indexer settings:

  1. Navigate to "Project properties -> C/C General -> Preprocessor Include Paths, Macros etc."
  2. Under the "Providers" tab, select "CDT GCC Built-in Compiler Settings."
  3. In the "Command to get compiler specs" field, append "-std=c 0x" or "-std=c 11."

After these modifications, the field should resemble the following:

${COMMAND} -E -P -v -dD ${INPUTS} -std=c++0x
Copy after login

Sources and Related Information

  • [Eclipse CDT FAQ](http://wiki.eclipse.org/CDT/User/FAQ#CDT_does_not_recognize_C.2B.2B11_features)
  • [Eclipse Forum Discussion](http://www.eclipse.org/forums/index.php/mv/msg/373462/909018/#msg_909018)

Additional Considerations

Note that this process only affects the Eclipse indexer and not the C compiler settings. If compilation fails due to missing C 11 settings, refer to the following resources:

  • [Eclipse CDT C 11/C 0x Support](https://www.eclipse.org/forums/index.php/mv/msg/403123/923927/#msg_923927)
  • [C 11 Compiler Enablement (Kepler and Before)](https://stackoverflow.com/a/17499266/760746)
  • [C 11 Compiler Enablement (Kepler and Newer)](https://stackoverflow.com/a/22480299/760746)

Compatibility

These configurations have been successfully tested with Eclipse versions:

  • Kepler (CDT 8.2)
  • Luna (CDT 8.4)

The above is the detailed content of How do I enable C 11 support in the Eclipse CDT indexer?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template