Posted by: sirivy | October 31, 2009

Note: Setup library and include paths to compile C++ code in Eclipse Galileo

Credit : P’Phong  @ dsin blogger

Example of my gcc in command line : gcc filename1.cpp filename2.cpp  -o test -I /home/jednipat/opencv/include/opencv/ -lhighgui -L /home/jednipat/opencv/lib/ -I/home/jednipat/levmar-2.4 -L/home/jednipat/levmar-2.4 -lm -llapack  -llevmar -I /home/jednipat/libsvm-2.89/ -L /home/jednipat/libsvm-2.89/

1. Create C++ project in Eclipse Galileo

2. After you finished create C++ project, you have to right click at your project name. Then, you have to select “Properties”.

3. In left panel, you have to choose “C/C++ Build”->Settings. Next, in right panel, you have to select tab “Tool Settings”.
To setup Include path (-I), select “GCC C++ Compiler” ->Directories and then you have to add your include path as the following pic.

Include paths(-I)

To setup Library paths (-L), you have to select “GCC C++ Linker”->Libraries in same tab Tool Settings. Then add  libraries (-l) and library searc path (-L) as the following pic.

Library paths (-L)

Click “OK” to finish adding library and include paths.

4. In my case, I have to setup environment variable too. To set environment variables, you have to click at “Run” on menu toolbar and then select “Run Configurations…”. Add environment variable like pic below.

Enviroment variable config

Click “Apply” and “Run”.


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


%d bloggers like this: