Search code examples
ceclipseeclipse-cdt

Does "open declaration" work across projects?


I'm using eclipse CDT (Kepler) as IDE for a C / C++ project that has libraries as separate projects.

Normally "open declaration" (context menu, right click on function call) will open the function declaration in the same or a different file within the same project.

Is it possible to get "open declaration" to open the function declaration in a different project? Both projects are open in the same workspace.


Solution

  • Yes it can, and does. A typical example might be where you have two projects: one a library, and the other a client of that library.

    In the client project, open its properties and select the 'Related Projects' tab. Then select the checkbox next to the project for the library project.

    Providing both projects are open, selecting the name of a library function in the source code of the client and hitting F3 will offer you a list of possible declarations for the function. Some may be in the header file, others will be in the library project.