Uncategorized

How to add include directory in Eclipse CDT

Code Yarns 👨‍💻

Many C/C++ projects may have to use header files that are not placed in the standard include directories. In some projects, the include files of the project itself are placed in one or more separate directories. For all such cases, you need to indicate Eclipse CDT to add these include directories to the compilation. Else your compilation fails with the error that an included header file cannot be found.

To add an include directory to your project in Eclipse CDT:

  1. Right-click on the project name in Project Explorer, choose Properties > C/C++ Build > Settings
  2. For include directory used by C++ files, choose Cross G++ Compiler > Includes. For C files, choose Cross GCC Compiler > Includes.

  3. In the Include paths section, click the + button and add the include directory. If you want to add multiple include directories, add them separately like this.

Tried with: Eclipse 3.7.2, Eclipse CDT…

View original post 5 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s