Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10
tcak via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun Oct 16 13:01:21 PDT 2016
On Sunday, 16 October 2016 at 17:42:44 UTC, tcak wrote:
> On Thursday, 13 October 2016 at 17:02:32 UTC, Nordlöw wrote:
>> [...]
>
> I have upgraded my Ubuntu to 16.10 yesterday as well, and I am
> getting following error:
>
> /usr/bin/ld: obj/Debug/program.o: relocation R_X86_64_32
> against symbol `_D9Exception7__ClassZ' can not be used when
> making a shared object; recompile with -fPIC
> /usr/bin/ld:
> /usr/lib/x86_64-linux-gnu/libphobos2.a(object_1_257.o):
> relocation R_X86_64_32 against symbol `__dmd_personality_v0'
> can not be used when making a shared object; recompile with
> -fPIC
> ...
>
> I guess the problem is same. Even though I have added
> "-defaultlib=libphobos2.so" to compiler options, problem
> persists.
Hmm. As the error message says, I compiled the program by adding
"-fPIC", it really has stopped giving error messages. That came
to me weird.
More information about the Digitalmars-d-learn
mailing list