Mihai Barbulescu via so <[email protected]> writes: > On 23 April 2015 at 20:35, Bogdan-Constantin PETCU via so > <[email protected]> wrote: >> Salut, >> >> Cand incerc sa compilez local obtin: >> >> bogdanpetcu@mystation:~/cod/tema3so/tema$ make >> cc -c -o vmsim.o vmsim.c >> gcc -Wall -g -fPIC -shared vmsim.o -o libvmsim.so >> /usr/bin/ld: vmsim.o: relocation R_X86_64_32 against `page_fault_handler' >> can not be used when making a shared object; recompile with -fPIC >> vmsim.o: error adding symbols: Bad value >> collect2: error: ld returned 1 exit status >> make: *** [libvmsim.so] Error 1 >> >> Any hints on that? > > Ai incercat sa recompilezi si folosind flag-ul -fPIC si aparea aceeasi > eroare? Chiar gcc-ul iti sugereaza asta (in mesajul erorii)
După cum a spus și Mihai mai sus, să compilezi și fișierul obiect vmsim.o folosind flag-ul -fPIC. În cazul tău ai compilat fișierul fără flag-ul -fPIC, vezi prima linie generată de comanda make. Răzvan _______________________________________________ http://ocw.cs.pub.ro/courses/so/info/lista-discutii
