tuto:linux:tuto_compilation
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| tuto:linux:tuto_compilation [2013/06/08 13:20] – [Exemples] root | tuto:linux:tuto_compilation [2013/06/08 17:19] (Version actuelle) – [Exemples] root | ||
|---|---|---|---|
| Ligne 261: | Ligne 261: | ||
| Hello, I'm a shared library : boo | Hello, I'm a shared library : boo | ||
| | | ||
| + | </ | ||
| + | |||
| + | * Include les 2 librairies dans une seule : | ||
| + | |||
| + | <code c compile6.sh> | ||
| + | #!/bin/bash | ||
| + | |||
| + | gcc -c -Wall -Werror -fpic foo.c | ||
| + | |||
| + | gcc -c -Wall -Werror -fpic boo.c | ||
| + | gcc -shared -o libgigix.so boo.o foo.o | ||
| + | |||
| + | gcc -L. -Wall -o test main.c -lgigix | ||
| + | |||
| + | export LD_LIBRARY_PATH=/ | ||
| + | ./test | ||
| + | |||
| + | ldd test | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | root@ks305337: | ||
| + | This is a shared library test... | ||
| + | Hello, I'm a shared library : foo | ||
| + | Hello, I'm a shared library : boo | ||
| + | linux-vdso.so.1 => (0x00007fff2e7fe000) | ||
| + | libgigix.so => / | ||
| + | libc.so.6 => / | ||
| + | / | ||
| </ | </ | ||
| Ligne 268: | Ligne 297: | ||
| Pour compiler un programme en static (par exemple python) : | Pour compiler un programme en static (par exemple python) : | ||
| < | < | ||
| - | ./configure LDFLAGS=" | + | ./configure LDFLAGS=" |
| </ | </ | ||
tuto/linux/tuto_compilation.1370697624.txt.gz · Dernière modification : de root
