Page 1 of 1

Configuring Default Libraries/Include Directives

Posted: Thu Feb 18, 2010 11:21 pm
by HJarausch
Hi,
I'd like to specify some libraries/include directives that should be included in every project.
(It's for a programming course for beginners in C++).
How can this be done.

(Codelite 2.2.0.3681 on GenToo Linux - built from source)

Re: Configuring Default Libraries/Include Directives

Posted: Fri Feb 19, 2010 8:54 am
by eranif
HJarausch wrote:I'd like to specify some libraries/include directives that should be included in every project.
You can only add a global include directives. This can be done from the menu: Settings > Build Settings > Compilers, Select your compiler, and then select the 'Advanced' page

Eran

Re: Configuring Default Libraries/Include Directives

Posted: Fri Feb 19, 2010 4:57 pm
by HJarausch
Thanks!

I've tried to put

/usr/local/lib -lMatrix

into the Libraries Path: field.

Unfortunately this generates

"-L /usr/local/lib -lMatrix"

without the quotation marks this would be fine.
Is it difficult to change that.

I need several libraries to linked in and I don't want my students to type them all in.

Thanks for a hint,
Helmut.

Re: Configuring Default Libraries/Include Directives

Posted: Fri Feb 19, 2010 6:04 pm
by eranif
The quotation marks are there for a reason: on windows there can be space in the paths.

Like I said: you can add path but not libraries.

Eran

Re: Configuring Default Libraries/Include Directives

Posted: Thu Feb 25, 2010 10:04 pm
by HJarausch
I have 2 questions, though.
How set a path with more than 1 component?

With project-settings Linker
To specify more than one library does work but is tricky

One has to say

Lib1 -lLib2
since the '-l1' is preprended to the whole string.

Or did I miss something?

Re: Configuring Default Libraries/Include Directives

Posted: Thu Feb 25, 2010 11:06 pm
by eranif
To add multiple libraries, simply add them as a semi-colon delimited list in the project settings -> Linker -> libraries:

Code: Select all

my_lib1;my_lib2;my_lib3
this will be converted into:

Code: Select all

-lmy_lib1 -lmy_lib2 -lmy_lib3
The same thing for adding search paths:

Code: Select all

/path/one;/path/two;...
Codelite will convert it to:

Code: Select all

-L"/path/one" -L"/path/two"
Eran