Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Workspace path as include directory not being resolved
Workspace path as include directory not being resolved [message #1779039] Fri, 29 December 2017 19:48 Go to next message
Brendan Simpson is currently offline Brendan SimpsonFriend
Messages: 1
Registered: December 2017
Junior Member
I am currently trying to set up a project for embedded development using the IAR Eclipse plugins. We have a large existing code base that has many common source files. I have successfully imported the common files using the "File System" import option. All the files were imported as links with virtual folders created as needed. Some of these files are header files.

The problem arises when I try to build. It seems as though Eclipse is not informing the IAR compiler of these directories to use as header file search paths. Ok, so I go to add the header file search paths manually to the C/C++ General > Paths and Symbols and added the paths as workspace paths (as I have done for other projects in the past), however this does not work.

So then I went to the compiler option in C/C++ Build > Settings > Preprocessor. Once again I added the appropriate paths as workspace paths to the preprocessor search path list. No luck.

Finally, I found that if I add the include paths, either in the General > Paths and Symbols or Preprocessor options as File System Paths, suddenly the compiler is able to locate the appropriate files.

Upon examining the output of the compiler in each of these test cases, I saw that when I tried adding workspace paths, no -I option was generated for the compiler call. I even tried to force it to do so by manually structuring the -I option in the extra options setting, but it appears that the workspace paths are not resolving properly. That is, when I added the -I option manually, the resultant command line showed the -I with no path after it, it was just blank.

Along the way there were some other clues alluding to this:
The includes folder in the project explorer (the one that automatically lists include paths) would gray-out my workspace paths, but would not gray-out file system paths.

I'd really like this to work because I think Eclipse is a superior IDE to IAR Embedded Workbench, and if I'm to win my coworkers over there needs to be a semi painless way to import our common files when starting new projects. Further, I'd ideally like CDT to locate these header locations and pass them to the compiler automatically, so that I don't have to go through the trouble of tracking down every directory where there is a header file. I had hoped that by importing through the file system import process that all the manually specified include path nonsense could be avoided.

Is this an issue with Eclipse itself or with the IAR tools that I'm trying to integrate with?
Re: Workspace path as include directory not being resolved [message #1779119 is a reply to message #1779039] Wed, 03 January 2018 02:36 Go to previous message
David VavraFriend
Messages: 778
Registered: October 2012
Senior Member
I tried this with the GCC tool chain under Oxygen.
Worked OK for me.

Perhaps the IAR plugin is different.
For one, the Project --> Properties --> C/C++ Build --> Settings --> [compiler] --> Preprocessor does not have provisions for include paths with the GCC tool chain under Oxygen.
Instead, it only has -D and -U for macro definitions.
Include paths are under Project --> Properties --> C/C++ Build --> Settings --> [compiler] --> Includes

You may need to take this up with the IAR Plugin provider.
Previous Topic:Access / include linux/module.h
Next Topic:Places to set Linux environment variables in Eclipse
Goto Forum:

Current Time: Tue Sep 25 22:30:36 GMT 2018

Powered by FUDForum. Page generated in 0.01653 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top