Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Relative include paths are still not supported (Relative include paths are still not supported despite statements on bugzilla that this was fixed over a year ago)
Relative include paths are still not supported [message #879924] Fri, 01 June 2012 02:10 Go to next message
David Sackstein is currently offline David Sackstein
Messages: 2
Registered: June 2012
Junior Member
My workspace looks something like this:

Include/InterfacesForLibrary1
Include/InterfacesForLibrary2
Include/InterfacesForLibrary3
Library1/src
Library2/src
Library3/src
Application/src

I need files in Application src to include interfaces from each of the libraries.
I tried relative paths in Paths and Symbols, but they are ignored.
I tried specifying "Workspace" and using various variables such as $(ProjectDirPath), $(WorkspaceDir) (dont catch me on the spelling, I did it right when I was working in the IDE). None of them worked.

I looked in Bugzilla and this is reported as bug 258277 and was apparently fixed in 2011.

But it isnt.
I dont know which CDT version I am using, but I installed the latest release on Ubuntu 1 month ago.

Can anyone help me perform this simple task?

Thanks

David

Re: Relative include paths are still not supported [message #880258 is a reply to message #879924] Fri, 01 June 2012 14:02 Go to previous messageGo to next message
Andrew Gvozdev is currently offline Andrew Gvozdev
Messages: 254
Registered: July 2009
Senior Member
${WorkspaceDirPath} and other variables are supposed to be spelled with curly brackets. Well, the best way to avoid catching on spelling is to spell right.
Another thing is that the folder should be present not only on disk but in a project in eclipse. You can also try to [Add...] directory path in Paths and Symbols and use [Workspace...] button. That should add it in a way that CDT is tuned to.

Andrew
Re: Relative include paths are still not supported [message #880272 is a reply to message #880258] Fri, 01 June 2012 14:31 Go to previous messageGo to next message
David Sackstein is currently offline David Sackstein
Messages: 2
Registered: June 2012
Junior Member
Hi Andrew, thanks for your quick response.

You write "Another thing is that the folder should be present not only on disk but in a project in eclipse"

Do you mean that I should be able to see my Include folder in the Project Explorer pane?

As you can see from my preferred layout structure above, I am referring to an Include folder that contains APIs for other libraries.
I would prefer not to have them embedded in the folders that contain the implementations of those APIs.

So, the result is that the Include folder is a peer of the project folders and is not inside any of them.

I understand I could change that approach, but this is what I prefer for all kinds of reasons, and I would like to think that even if its not "best" according to some, it should be possible to have this flexibility when using Eclipse.

So, the Include folder doesnt appear in the Project Explorer pane.
Now I could add it, if this is absolutely necessary for it to be recognized in the "Paths and Symbols" property page, but I dont now how to do it.

I tried right clicking on the Project Explorer pane and adding all kinds of options.
That seemed to take me along the track to either creating a new folder or linking to an existing resource.

I suppose I am doing the latter, though it bugs me why a simple request to add a relative path requires me to select an Advanced button to add Linked Resources and read up about what that exactly does.

Why isnt it enough to simply have those files on disk?
If I do need to add them to the workspace, how should that be done?

Thanks

David
Re: Relative include paths are still not supported [message #880282 is a reply to message #880272] Fri, 01 June 2012 14:57 Go to previous message
Andrew Gvozdev is currently offline Andrew Gvozdev
Messages: 254
Registered: July 2009
Senior Member
David Sackstein wrote on Fri, 01 June 2012 14:31

Do you mean that I should be able to see my Include folder in the Project Explorer pane?

Yes, pretty much so. If the folders are not in Project Explorer they are not visible to eclipse. I do not claim that that it is the best for C/C++ setups but that's how it is.

One way to get eclipse to see them is, as you mentioned, to make linked folder. Another way which I prefer in setups like that is to create a separate project (using New Project Wizard), say "Include" or "Interfaces". As a consolation you would be able to view the code and generally have smoother handling of it by CDT.

Thanks,
Andrew
Previous Topic:Extremely bad performance on some sources
Next Topic:Convert project from C to C++
Goto Forum:
  


Current Time: Sat Aug 23 05:29:24 EDT 2014

Powered by FUDForum. Page generated in 0.02083 seconds