Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Indexer with multiple projects
Indexer with multiple projects [message #1008245] Mon, 11 February 2013 17:37 Go to next message
Josh Kelley is currently offline Josh KelleyFriend
Messages: 5
Registered: July 2009
Junior Member
In Eclipse Juno (Eclipse 4.2 with Eclipse CDT 8.1), I have multiple projects set up: several libraries that we maintain and several applications that are based on those libraries.

The indexer works great for each library, and it works okay for each of the projects (it's able to correctly resolve a project's references to library symbols). However, the indexer never automatically updates an application when one of its dependent projects changes. So, for example, if I edit a library's .h file to add a function then edit an application's .cpp file to add a call to the new function, the CDT's code analysis flags it as an unresolved symbol within that application project. The only workaround I've found is to manually right-click on the application in the Eclipse Project Explorer, go under Index, and chose Update with Modified Files.

Is there a way to have the indexer automatically update a project whenever source files in another project change?
Re: Indexer with multiple projects [message #1008615 is a reply to message #1008245] Wed, 13 February 2013 10:12 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Each project has its own index. You must export the index.
For example you have project lib and project app and you want to use some classes/functions from lib in your app.

- Open Project Properties of project lib
- C/C++ General->Export Settings
In Tab Includes click "Add..." and then select "Workspace..." /lib

- Open Project Properties of project app
- C/C++ General->Paths and Symbols
In Tab References select project lib


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Indexer with multiple projects [message #1011023 is a reply to message #1008615] Mon, 18 February 2013 17:27 Go to previous messageGo to next message
Josh Kelley is currently offline Josh KelleyFriend
Messages: 5
Registered: July 2009
Junior Member
Thank you for your reply.

As far as I can tell, my indexer settings are fine; the CDT's autodiscovery is picking up lib as one of app's include directories, and the indexer in app is able to resolve symbols from lib.

My problem is that app doesn't pick up changes to lib unless I manually reindex app. This is a bit tedious, so I'm wondering if there's a way to have app automatically update its index for changes to lib (just like app automatically updates its index for changes to app).
Re: Indexer with multiple projects [message #1011252 is a reply to message #1011023] Tue, 19 February 2013 07:24 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Josh Kelley wrote on Mon, 18 February 2013 18:27

My problem is that app doesn't pick up changes to lib unless I manually reindex app. This is a bit tedious, so I'm wondering if there's a way to have app automatically update its index for changes to lib (just like app automatically updates its index for changes to app).

I noticed the same erroneous behavior recently. According to this bug entry https://bugs.eclipse.org/bugs/show_bug.cgi?id=310837 it should have been fixed long ago. I will setup a small test project to see if I can reproduce it.
I could reproduce the bug locally. I made an attachment to the above mentioned bugzilla entry. Hopefully one of the CDT dev will have a look at it.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google

[Updated on: Tue, 19 February 2013 07:44]

Report message to a moderator

Re: Indexer with multiple projects [message #1011540 is a reply to message #1011252] Tue, 19 February 2013 18:58 Go to previous message
Josh Kelley is currently offline Josh KelleyFriend
Messages: 5
Registered: July 2009
Junior Member
Axel Mueller wrote on Tue, 19 February 2013 02:24

I noticed the same erroneous behavior recently. According to this bug entry https://bugs.eclipse.org/bugs/show_bug.cgi?id=310837 it should have been fixed long ago. I will setup a small test project to see if I can reproduce it.
I could reproduce the bug locally. I made an attachment to the above mentioned bugzilla entry. Hopefully one of the CDT dev will have a look at it.


Thank you very much for your help. I'll watch that bug for further info.
Previous Topic:EOF during runtime in C console
Next Topic:running gdb as root without running eclipse as root
Goto Forum:
  


Current Time: Wed Apr 24 22:49:31 GMT 2024

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

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

Back to the top