How to add library path in Eclipse CDT

A C/C++ project may need to be linked with library files that are not placed in the standard library path locations. To indicate to the compiler to search these paths, you typically use the compiler option -L. For example, the option -L/usr/local/foobar makes the compiler search the directory /usr/local/foobar for library files to link with your program.

Similarly, to add a library path to the compilation of your project in Eclipse CDT:

  1. Right-click on the project name in Project Explorer, choose Properties > C/C++ Build > Settings > Tool Settings.

  2. Go to Cross G++ Linker > Libraries > Library search path.

  3. Click the + button and add the library path. For example, add /usr/local/foobar. If you want to add multiple paths, add them separately like this.

Tried with: Eclipse 3.7.2, Eclipse CDT 8.0.2 and Ubuntu 12.04 LTS


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.