Hello,
I am trying to compile some code but when I run make I get the following error:
make[1]: Entering directory `/home/amok/local/nci/suif/suif2b/common' /usr/bin/g++ -shared -o /home/amok/local/nci/solib/libcommon.so \ formatted.o MString.o text_util.o suif_map.o suif_hash_map.o lstring.o hash_table.o i_integer.o sparse_vector.o suif_gc_obj.o suif_gc_map.o -L/home/amok/local/nci/solib \ -L/home/amok/local/nci/solib /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.5/../../../../x86_64-suse-linux/bin/ld: formatted.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC formatted.o: could not read symbols: Bad value collect2: ld returned 1 exit status make[1]: *** [/home/amok/local/nci/solib/libcommon.so] Error 1 make[1]: Leaving directory `/home/amok/local/nci/suif/suif2b/common' make: *** [dummy] Error 2
what does this mean?
Regards
* Argiris Mokios amok@auth.gr [051017 13:25]:
Hello,
I am trying to compile some code but when I run make I get the following error:
make[1]: Entering directory `/home/amok/local/nci/suif/suif2b/common' /usr/bin/g++ -shared -o /home/amok/local/nci/solib/libcommon.so \ formatted.o MString.o text_util.o suif_map.o suif_hash_map.o lstring.o hash_table.o i_integer.o sparse_vector.o suif_gc_obj.o suif_gc_map.o -L/home/amok/local/nci/solib \ -L/home/amok/local/nci/solib /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.5/../../../../x86_64-suse-linux/bin/ld: formatted.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC formatted.o: could not read symbols: Bad value collect2: ld returned 1 exit status make[1]: *** [/home/amok/local/nci/solib/libcommon.so] Error 1 make[1]: Leaving directory `/home/amok/local/nci/suif/suif2b/common' make: *** [dummy] Error 2
what does this mean?
You have compiled formatted.o without -fPIC, thus you cannot link it to a shared library. Probably all the other object files as well.
PIC means: Position Independant Code
-fPIC is necessary for all shared objects.
Regards
-- Epur Si Muove
regards,
Stefan
Stefan Fent wrote:
- Argiris Mokios amok@auth.gr [051017 13:25]:
Hello,
I am trying to compile some code but when I run make I get the following error:
make[1]: Entering directory `/home/amok/local/nci/suif/suif2b/common' /usr/bin/g++ -shared -o /home/amok/local/nci/solib/libcommon.so \ formatted.o MString.o text_util.o suif_map.o suif_hash_map.o lstring.o hash_table.o i_integer.o sparse_vector.o suif_gc_obj.o suif_gc_map.o -L/home/amok/local/nci/solib \ -L/home/amok/local/nci/solib /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.5/../../../../x86_64-suse-linux/bin/ld: formatted.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC formatted.o: could not read symbols: Bad value collect2: ld returned 1 exit status make[1]: *** [/home/amok/local/nci/solib/libcommon.so] Error 1 make[1]: Leaving directory `/home/amok/local/nci/suif/suif2b/common' make: *** [dummy] Error 2
what does this mean?
You have compiled formatted.o without -fPIC, thus you cannot link it to a shared library. Probably all the other object files as well.
PIC means: Position Independant Code
-fPIC is necessary for all shared objects.
Regards
-- Epur Si Muove
regards,
Stefan
Thank you very much Stefan, indeed that was the case..