~ubuntu-branches/ubuntu/trusty/anjuta/trusty

« back to all changes in this revision

Viewing changes to manuals/anjuta-manual/th/project-manager-library.page

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2012-02-20 22:38:35 UTC
  • mfrom: (1.1.43)
  • Revision ID: package-import@ubuntu.com-20120220223835-ny223imz62qkk9ns
Tags: 2:3.3.90-0ubuntu1
* New upstream release.
* debian/rules: Watch for unstable releases

Show diffs side-by-side

added added

removed removed

Lines of Context:
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">
3
3
 
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"/>
7
11
    <desc>
8
 
      Add or remove non-packaged libraries from a project.
 
12
      Add or remove libraries to project targets.
9
13
    </desc>
10
14
    <credit type="author">
11
15
      <name>Sébastien Granjoux</name>
12
16
      <email>seb.sfo@free.fr</email>
13
17
    </credit>
14
 
    <credit type="editor">
15
 
      <name>Philip Chimento</name>
16
 
      <email>philip.chimento@gmail.com</email>
17
 
    </credit>
18
18
  </info>
19
19
 
20
 
  <title>Add or remove non-packaged libraries</title>
21
 
 
22
 
  <section>
23
 
    <title>Add a non-packaged library to a target</title>
24
 
 
25
 
    <p>
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.
30
 
    </p>
31
 
 
32
 
    <steps>
33
 
      <item>
34
 
        <p>
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>.
39
 
        </p>
40
 
        <p> 
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.
46
 
        </p>
47
 
      </item>
48
 
      <item>
49
 
        <p>
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
56
 
          directory.
57
 
        </p>
58
 
        <p>
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.
61
 
        </p>
62
 
      </item>
63
 
      <item>
64
 
        <p>
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>.
70
 
        </p>
71
 
        <p> 
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.
77
 
        </p>
78
 
      </item>
79
 
      <item>
80
 
        <p>
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.
86
 
        </p>
87
 
        <p>
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>.
91
 
        </p>  
92
 
      </item>
93
 
    </steps>
94
 
  </section>
95
 
 
96
 
  <section>
97
 
    <title>Remove a non packaged library from a target</title>
98
 
 
99
 
    <steps>
100
 
      <item>
101
 
        <p>
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>.
106
 
        </p>
107
 
      </item>
108
 
      <item>
109
 
        <p>
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.
114
 
        </p>
115
 
      </item>
116
 
    </steps>
117
 
 
118
 
  </section>
119
 
 
 
20
  <title>Manage Libraries</title>
120
21
</page>