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

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2012-03-06 01:11:30 UTC
  • mfrom: (1.1.44)
  • Revision ID: package-import@ubuntu.com-20120306011130-yumg9s1nprogue2a
Tags: 2:3.3.91-0ubuntu1
* New upstream release.
* debian/control.in:
  - Bump minimum glade to 3.11 and vala to 0.16

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="utf-8"?>
 
2
<page xmlns="http://projectmallard.org/1.0/" type="topic" style="task" id="project-manager-library-add" xml:lang="gl">
 
3
 
 
4
  <info xmlns:facet="http://projectmallard.org/facet/1.0/">
 
5
    <facet:tag key="all-pages" value="whatever"/> <!--Include page in index-->
 
6
    <link type="guide" xref="project-manager-library" group="sixth"/>
 
7
    <link type="seealso" xref="project-manager-target"/>
 
8
    <revision pkgversion="3.0" version="0.1" date="2011-03-27" status="incomplete"/>
 
9
    <desc>Engadir unha biblioteca personalizada a un obxectivo.</desc>
 
10
    <credit type="author">
 
11
      <name>Sébastien Granjoux</name>
 
12
      <email>seb.sfo@free.fr</email>
 
13
    </credit>
 
14
    <credit type="editor">
 
15
      <name>Philip Chimento</name>
 
16
      <email>philip.chimento@gmail.com</email>
 
17
    </credit>
 
18
  </info>
 
19
 
 
20
  <title>Engadir unha biblioteca personalizada</title>
 
21
 
 
22
  <p>It is easier to use a packaged library, which is common on Linux, so
 
23
  check if it is the case <link xref="project-manager-module-new">here</link>.
 
24
  But else you can still use the library as explained below.</p>
 
25
 
 
26
  <p>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.</p>
 
30
 
 
31
  <steps>
 
32
    <item>
 
33
      <p>Select the directory containing the program where you want to
 
34
      add the library in the <gui>project view</gui>, click on the
 
35
      right mouse button to make the <gui>project context menu</gui>
 
36
      appear and select <gui>Properties</gui>.</p>
 
37
 
 
38
      <p>Or from the <gui>main menu</gui>, select <guiseq><gui>Project</gui>
 
39
      <gui>Properties</gui></guiseq>. By default, it edits the
 
40
      properties of the currently selected item in the project view.
 
41
      You can select a different item in the drop-down list button.</p>
 
42
    </item>
 
43
    <item>
 
44
      <p>If the header files are installed in a standard location
 
45
      (<file>/usr/include</file>) you don't have to set this. If not,
 
46
      you need to add <input>-I<var>include_path</var></input> in
 
47
      the <gui>C preprocessor flags</gui> property if you are using
 
48
      <app>gcc</app> as your compiler. You can add several paths separated with
 
49
      spaces. These options will be used for all targets inside this
 
50
      directory.</p>
 
51
 
 
52
      <p>You might have to expand the <gui>More options</gui> button to see this.
 
53
      Click on the <gui>Apply</gui> button when you are done.</p>
 
54
    </item>
 
55
    <item>
 
56
      <p>Next, you need to add the library to a target.
 
57
      Select the target where you want to
 
58
      add the library in the <gui>project view</gui>, click on the
 
59
      right mouse button to make the <gui>project context menu</gui>
 
60
      appear and select <gui>Properties</gui>.</p>
 
61
 
 
62
      <p>Or from the <gui>main menu</gui>, select <guiseq><gui>Project</gui>
 
63
      <gui>Properties</gui></guiseq>. By default, it edits the
 
64
      properties of the currently selected item in the project view.
 
65
      You can select a different item in the drop-down list button.</p>
 
66
    </item>
 
67
    <item>
 
68
      <p>You need to set the <gui>Linker flags</gui> property, adding
 
69
      <input>-l<var>library_name</var></input> if your compiler is <app>gcc</app>.
 
70
      <var>library_name</var> is the name of the library file without the
 
71
      <file>lib</file> prefix and without the <file>.a</file> or
 
72
      <file>.so</file> extension.</p>
 
73
 
 
74
      <p>If the library is in not in a standard directory, <app>gcc</app>
 
75
      can look in additional directories with the option
 
76
      <input>-L<var>library_path</var></input>.</p>  
 
77
    </item>
 
78
  </steps>
 
79
 
 
80
</page>