15
15
<name>Philip Chimento</name>
16
16
<email>philip.chimento@gmail.com</email>
19
<mal:credit xmlns:mal="http://projectmallard.org/1.0/" type="translator copyright">
20
<mal:name>Mario Blättermann</mal:name>
21
<mal:email>mario.blaettermann@gmail.com</mal:email>
22
<mal:years>2009-2013</mal:years>
25
<mal:credit xmlns:mal="http://projectmallard.org/1.0/" type="translator copyright">
26
<mal:name>Jonas Rebmann</mal:name>
27
<mal:email>jonas.rebmann@googlemail.com</mal:email>
28
<mal:years>2010</mal:years>
31
<mal:credit xmlns:mal="http://projectmallard.org/1.0/" type="translator copyright">
32
<mal:name>Christian Kirbach</mal:name>
33
<mal:email>christian.kirbach@gmail.com</mal:email>
34
<mal:years>2010, 2011, 2012, 2013</mal:years>
38
20
<title>Eine benutzerdefinierte Bibliothek hinzufügen</title>
40
<p>Es ist einfacher eine Bibliothek als Paket zu verwenden. Dies ist unter Linux üblich. Prüfen Sie <link xref="project-manager-module-new">hier</link>, ob dies der Fall ist. Andernfalls können Sie immer noch die Bibliothek wie unten erklärt verwenden.</p>
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>
42
26
<p>Um eine Bibliothek in C nutzen zu können, müssen Sie dem Compiler mitteilen, wo sich die Header-Dateien befinden und dem Linker mitteilen, wo die erforderlichen Bibliotheken aufzufinden sind. Das Problem ist, dass Ihr Programm nicht auf einem anderen Rechner kompilieren wird, wenn sich die Header- oder Bibliotheksdateien an einem anderen Ort befinden.</p>
46
<p>Wählen Sie in der <gui>Projektansicht</gui> den Ordner mit dem Programm, in welchem Sie die Bibliothek hinzufügen möchten. Drücken Sie dann die rechte Maustaste, um das <gui>Projekt-Kontextmenü</gui> zu öffnen, und wählen Sie <gui>Eigenschaften</gui>.</p>
48
<p>Oder wählen Sie im <gui>Hauptmenü</gui> <guiseq><gui>Projekt</gui><gui>Eigenschaften</gui></guiseq>. Per Voreinstellung werden die Eigenschaften des aktuell in der Projektansicht ausgewählten Objekts bearbeitet. Wählen Sie bei Bedarf ein anderes Objekt in der Auswahlliste.</p>
51
<p>Wenn die Header-Dateien im üblichen Pfad installiert sind (<file>/usr/include</file>), müssen Sie nichts weiter tun. Andernfalls müssen Sie<input>-I<var>include_path</var></input> den <gui>C-Präprozessorflags</gui> hinzufügen, wenn Sie <app>gcc</app> einsetzen.</p>
53
<p>Eventuell müssen Sie den Knopf <gui>Weitere Optionen</gui> ausklappen, um dies sehen zu können. Klicken Sie auf den Knopf <gui>Anwenden</gui>, sobald Sie fertig sind.</p>
56
<p>Als nächstes müssen Sie die Bibliothek einem Ziel hinzufügen. Wählen Sie in der <gui>Projektansicht</gui> das Ziel, dem Sie die Bibliothek hinzufügen wollen. Drücken Sie dann die rechte Maustaste, um das <gui>Kontextmenü des Projekts</gui> zu öffnen, und wählen Sie <gui>Eigenschaften</gui>.</p>
58
<p>Oder wählen Sie im <gui>Hauptmenü</gui> <guiseq><gui>Projekt</gui><gui>Eigenschaften</gui></guiseq>. Per Voreinstellung werden die Eigenschaften des aktuell in der Projektansicht ausgewählten Objekts bearbeitet. Wählen Sie bei Bedarf ein anderes Objekt in der Auswahlliste.</p>
61
<p>Sie müssen die Eigenschaft <gui>Linker-flags</gui> festlegen, indem Sie <input>-l<var>Bibliotheks_Name</var></input> hinzufügen, wenn Ihr Compiler <app>gcc</app> ist. <var>>Bibliotheks_Name</var> ist der Name der Bibliotheksdatei ohne das Präfix <file>lib</file> und ohne die Erweiterung <file>.a</file> oder <file>.so</file>.</p>
63
<p>Wenn die Bibliothek nicht in einem Standardordner liegt, so schaut <app>gcc</app> mit der Option <input>-L<var>Bibliotheks_Name</var></input> in weiteren Ordnern nach.</p>
30
<p>Select the directory containing the program where you want to
31
add the library in the <gui>project view</gui>, click on the
32
right mouse button to make the <gui>project context menu</gui>
33
appear and select <gui>Properties</gui>.</p>
35
<p>Or from the <gui>main menu</gui>, select <guiseq><gui>Project</gui>
36
<gui>Properties</gui></guiseq>. By default, it edits the
37
properties of the currently selected item in the project view.
38
You can select a different item in the drop-down list button.</p>
41
<p>If the header files are installed in a standard location
42
(<file>/usr/include</file>) you don't have to set this. If not,
43
you need to add <input>-I<var>include_path</var></input> in
44
the <gui>C preprocessor flags</gui> property if you are using
45
<app>gcc</app> as your compiler. You can add several paths separated with
46
spaces. These options will be used for all targets inside this
49
<p>You might have to expand the <gui>More options</gui> button to see this.
50
Click on the <gui>Apply</gui> button when you are done.</p>
53
<p>Next, you need to add the library to a target.
54
Select the target where you want to
55
add the library in the <gui>project view</gui>, click on the
56
right mouse button to make the <gui>project context menu</gui>
57
appear and select <gui>Properties</gui>.</p>
59
<p>Or from the <gui>main menu</gui>, select <guiseq><gui>Project</gui>
60
<gui>Properties</gui></guiseq>. By default, it edits the
61
properties of the currently selected item in the project view.
62
You can select a different item in the drop-down list button.</p>
65
<p>You need to set the <gui>Linker flags</gui> property, adding
66
<input>-l<var>library_name</var></input> if your compiler is <app>gcc</app>.
67
<var>library_name</var> is the name of the library file without the
68
<file>lib</file> prefix and without the <file>.a</file> or
69
<file>.so</file> extension.</p>
71
<p>If the library is in not in a standard directory, <app>gcc</app>
72
can look in additional directories with the option
73
<input>-L<var>library_path</var></input>.</p>