1
1
<?xml version="1.0" encoding="utf-8"?>
2
<page xmlns="http://projectmallard.org/1.0/" type="topic" style="task" id="project-manager-library" xml:lang="th">
2
<page xmlns="http://projectmallard.org/1.0/" type="guide" style="task" id="project-manager-library" groups="first second third fourth fifth sixth seventh" xml:lang="th">
4
4
<info xmlns:facet="http://projectmallard.org/facet/1.0/">
5
5
<facet:tag key="all-pages" value="whatever"/> <!--Include page in index-->
6
<link type="guide" xref="index#anjuta-project-management" group="fourth"/>
7
<link type="seealso" xref="project-manager"/>
8
<link type="seealso" xref="project-manager-treeview"/>
9
<link type="seealso" xref="project-manager-target"/>
6
10
<revision pkgversion="3.0" version="0.1" date="2011-03-27" status="incomplete"/>
8
Add or remove non-packaged libraries from a project.
12
Add or remove libraries to project targets.
10
14
<credit type="author">
11
15
<name>Sébastien Granjoux</name>
12
16
<email>seb.sfo@free.fr</email>
14
<credit type="editor">
15
<name>Philip Chimento</name>
16
<email>philip.chimento@gmail.com</email>
20
<title>Add or remove non-packaged libraries</title>
23
<title>Add a non-packaged library to a target</title>
26
In order to use a library in C, you need to tell the compiler
27
where the header files are, and tell the linker where to find the
28
needed libraries. The issue is that your program will not compile
29
on another computer if the header and the libraries are elsewhere.
35
Select the directory containing the program where you want to
36
add the library in the <gui>project view</gui>, click on the
37
right mouse button to make the <gui>project context menu</gui>
38
appear and select <gui>Properties</gui>.
41
Or from the <gui>main menu</gui>, select <guiseq><gui>Project</gui>
42
<gui>Properties</gui></guiseq>. By default, it edits the
43
properties of the currently selected item in the project view.
44
You can select a different node, by expanding
45
<gui>Browse other nodes</gui> and selecting another one.
50
If the header files are installed in a standard location
51
(<file>/usr/include</file>) you don't have to set this. If not,
52
you need to add <input>-I<var>include_path</var></input> in
53
the <gui>C preprocessor flags</gui> property if you are using
54
<app>gcc</app> as your compiler. You can add several paths separated with
55
spaces. These options will be used for all targets inside this
59
You might have to expand the <gui>More options</gui> button to see this.
60
Click on the <gui>Apply</gui> button when you are done.
65
Next, you need to add the library to a target.
66
Select the target where you want to
67
add the library in the <gui>project view</gui>, click on the
68
right mouse button to make the <gui>project context menu</gui>
69
appear and select <gui>Properties</gui>.
72
Or from the <gui>main menu</gui>, select <guiseq><gui>Project</gui>
73
<gui>Properties</gui></guiseq>. By default, it edits the
74
properties of the currently selected item in the project view.
75
You can select a different node, by expanding
76
<gui>Browse other nodes</gui> and selecting another one.
81
You need to set the <gui>Linker flags</gui> property, adding
82
<input>-l<var>library_name</var></input> if your compiler is <app>gcc</app>.
83
<var>library_name</var> is the name of the library file without the
84
<file>lib</file> prefix and without the <file>.a</file> or
85
<file>.so</file> extension.
88
If the library is in not in a standard directory, <app>gcc</app>
89
can look in additional directories with the option
90
<input>-L<var>library_path</var></input>.
97
<title>Remove a non packaged library from a target</title>
102
Select the target that has the library you want to remove in the
103
<gui>project view</gui>, click on the right mouse button to
104
make the <gui>project context menu</gui> appear and select
105
<gui>Properties</gui>.
110
Remove the library from the
111
<gui>C preprocessor flags</gui> and <gui>Linker flags</gui>
112
properties. Click on the <gui>Apply</gui> button to write the
113
changes to the project files.
20
<title>Manage Libraries</title>