Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to attach source to the libraries on Eclipse CDT

On Eclipse CDT, does someone know how to have the external libraries attached by their source codes?

What I want to do is to click the element (e.g. function, variable) names so that Eclipse opens the corresponding part of its source file (or open header file initially, then open source with another click in header). It's possible in Eclipse' Java mode.

Thanks.

like image 325
IsaacS Avatar asked Jul 22 '11 00:07

IsaacS


People also ask

Can you code C in Eclipse?

To use Eclipse for C/C++ programming, you need a C/C++ compiler. On Windows, you could install either MinGW GCC or Cygwin GCC. Choose MinGW if you are not sure, because MinGW is lighter and easier to install, but having less features.

How to Setup c++ environment in Eclipse?

Launch Eclipse → Help → Install New Software → In "Work with" field, pull down the drop-down menu and select "Kepler - http://download.eclipse.org/releases/kepler" (or juno for Eclipse 4.2; or helios for Eclipse 3.7). In "Name" box, expand "Programming Language" node ⇒ Check "C/C++ Development Tools" ⇒ "Next" ⇒ ...

What is Eclipse CDT plugin?

The CDT is Eclipse's C/C++ Development Tooling project. It is an industrial-strength C/C++ IDE that also serves as a platform for others to provide value-added tooling for C/C++ developers.


2 Answers

Create a library project. Add external library into it. Open library project Properties, link sources folders via C/C++ General/Paths and Symbols/Source location. Open main project Properties and add library project to Project References.

If you did everything right, Open Declaration action (F3) will open a function sources.

Cheers, Max

like image 132
Max Avatar answered Oct 27 '22 12:10

Max


In the project explorer you can

  1. right click on the folder name
  2. click on rescource configurations
  3. select exclude from build
like image 28
Arya Avatar answered Oct 27 '22 12:10

Arya