[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dynamic libs example code
> > Hmm, I don't know what article you refer to, but making shared libraries
> > is not difficult. Basically you need to make sure the code is compiled
> > with the switch '-fpic' and the library is finally linked with the switch
> > '-shared'. Such as:
> > gcc -fpic -c Part1.c
> > gcc -fpic -c Part2.c
> > gcc -shared -o MyLib.so Part1.o Part2.o -lOtherNeededLib
> I was wondering if anybody could illuminate me about those -fpic
> flags... The man pages are quite cryptic about them. The libraries I
> tried seems to work even *without* this flag (both in regular "-l" usage
> and using dlopen), and anyway, what ARE "large displacement branches"
> (the thing -fPIC is about)?
> When should I use -fPIC rather than -fpic? Depends on the platform? Why
> doesn't it make any difference when I do not use those flags?
Marcelo Elias Del Valle UIN: 30595143
JŠ visitou o gamesnow hoje?
-----BEGIN GEEK CODE BLOCK-----
GE d- s+:+ a-- C++>$ UL P+ L+++ E W+ N+ o- K w-- O-- M+ V- PS++
Y+ PGP t+ 5? X R+ tv- b+ DI++ D++ G e- h r(-) z+
------END GEEK CODE BLOCK------