[so] [Tema 4]Problema linkare

Stefan Munteanu stef8803 at gmail.com
Mon May 9 18:06:40 EEST 2011


On Mon, May 9, 2011 at 5:55 PM, Cioponea Catalin
<cioponea_cata at yahoo.com> wrote:
>      Salut,
>
>      Am urmatoarea problema cu Makefile-ul.Ii rog pe cei care inteleg
> eroarea, si stiu cauza, sa ma ajute.
>
> gcc -Wall -shared -fPIC -o LibMonitor.so LibMonitor.o
>
> /usr/bin/ld: LibMonitor.o: relocation R_X86_64_32 against `.rodata' can not
> be used when making a shared object; recompile with -fPIC
> LibMonitor.o: could not read symbols: Bad value
> collect2: ld returned 1 exit status
> make: *** [LibMonitor.so] Error 1

Salut,

Daca ai urma exemplul din laboratorul 1, ai observa ca flagul -fPIC
trebuie pus la compilarea fisierului obiect si nu la compilarea
bibliotecii.

Stefan.


More information about the so mailing list