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>Kelemen Gábor</mal:name>
21
<mal:email>kelemeng at gnome dot hu</mal:email>
22
<mal:years>2012, 2013.</mal:years>
20
26
<title>Egyéni programkönyvtár hozzáadása</title>
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>
28
<p>A Linux alatt gyakori csomagolt programkönyvtárak használata egyszerűbb, emiatt <link xref="project-manager-module-new">ellenőrizze</link>, hogy nem áll-e rendelkezésre ilyen. Egyéb esetben az alábbiakban ismertetett módon használhatja a programkönyvtárat.</p>
26
30
<p>Egy programkönyvtár C-ből való használatához meg kell adnia a fordítónak, hogy hol vannak a fejlécfájlok, és a szerkesztőnek, hogy hol találja a szükséges programkönyvtárakat. A probléma az, hogy a programja nem fog lefordulni egy másik számítógépen, ha a fejlécek és a programkönyvtárak más helyen vannak.</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>
34
<p>Válassza ki a <gui>projektnézetben</gui> a programot tartalmazó könyvtárat, amelybe a programkönyvtárat fel kívánja venni, kattintson a jobb egérgombbal a <gui>helyi menü</gui> megjelenítéséhez, és válassza ki a <gui>Tulajdonságok</gui> menüpontot.</p>
36
<p>A <gui>főmenüből</gui> kiválaszthatja a <guiseq><gui>Projekt</gui><gui>Tulajdonságok</gui></guiseq> menüpontot is. Alapesetben ez a projektnézetben éppen kijelölt elem tulajdonságait szerkeszti. A legördülő lista gombbal kiválaszthat egy másik elemet.</p>
39
<p>Ha a fejlécfájlok szabványos helyre vannak telepítve (<file>/usr/include</file>), akkor ezt nem kell beállítania. Ellenkező esetben a <gui>C előfeldolgozó jelzői</gui> tulajdonsághoz fel kell vennie a <input>-I<var>include_útvonal</var></input> paramétert, ha a <app>gcc</app> fordítót használja.</p>
41
<p>Ennek megjelenítéséhez szükség lehet a <gui>További beállítások</gui> gomb megnyomására. Nyomja meg az <gui>Alkalmaz</gui> gombot, ha befejezte.</p>
44
<p>Ezután hozzá kell adnia a programkönyvtárat a célhoz. Válassza ki a <gui>projektnézetben</gui> a célt, amelybe a programkönyvtárat fel kívánja venni, kattintson a jobb egérgombbal a <gui>helyi menü</gui> megjelenítéséhez, és válassza ki a <gui>Tulajdonságok</gui> menüpontot.</p>
46
<p>A <gui>főmenüből</gui> kiválaszthatja a <guiseq><gui>Projekt</gui><gui>Tulajdonságok</gui></guiseq> menüpontot is. Alapesetben ez a projektnézetben éppen kijelölt elem tulajdonságait szerkeszti. A legördülő lista gombbal kiválaszthat egy másik elemet.</p>
49
<p>Be kell állítania a <gui>Szerkesztő paraméterei</gui> tulajdonságot, a <input>-l<var>programkönyvtár_neve</var></input> felvételével, ha a <app>gcc</app> fordítót használja. A <var>programkönyvtár_neve</var> a programkönyvtár fájlneve a <file>lib</file> előtag és a <file>.a</file> vagy <file>.so</file> kiterjesztés nélkül.</p>
51
<p>Ha a programkönyvtár nem szabványos könyvtárban van, akkor a <app>gcc</app> további könyvtárakban is képes keresni a <input>-L<var>programkönyvtár_útvonala</var></input> kapcsoló megadásával.</p>