Error While linking lazarus / 1-Linux ---------------------------------------------------------------------- lloydiet · 2006-11-03 18:06 I am just trying my first app using lazarus for a windows background. I am getting some linker errors trying to build a library, but I do not understand what the problem is. Here are the follwing errors: Code: [Select] /usr/bin/ld: /opt/fpc/lib/fpc/2.0.4/units/x86_64-linux/rtl/system.o: relocation R_X86_64_32S against `TC_SYSTEM_ISMULTITHREAD' can not be used when making a shared object; recompile with -fPIC /opt/fpc/lib/fpc/2.0.4/units/x86_64-linux/rtl/system.o: could not read symbols: Bad value callconv.lpr(26,1) Error: Error while linking Can you help? ---------------------------------------------------------------------- ShaunS · 2007-01-05 17:53 Hi, I am getting a similar problem when compiling my library. It works well in 32-bit mode but I get the following error when linking in 64-bit mode. Linking libfpacore2.so /usr/bin/ld: /usr/lib64/gcc/x86_64-suse-linux/4.1.2/crtbegin.o: relocation R_X86_64_32 against `_Jv_RegisterClasses' can not be used when making a shared object; recompile with -fPIC /usr/lib64/gcc/x86_64-suse-linux/4.1.2/crtbegin.o: could not read symbols: Bad value fpacore2.lpr(39,3) Error: Error while linking I am using openSUSE Linux 10.2 x86_64 Thank you, Shaun PS: How do I recompile with -fPIC from Lazarus? ---------------------------------------------------------------------- ShaunS · 2007-01-11 16:55 Hi, I have found out that this is a Free Pascal problem. I do not know the solution yet, but have not given up yet. The -fPIC compile option is a red herring, it is listed because the loader (ld) assumes that the code was compiled with gcc. There was a suggestion to use the -Cp command line switch with the free pascal compiler, but I have had no success. Cheers Shaun