November 03, 2016
Hi,

with a fresh Ubuntu 16.10 installation using "Hello, World" I got a list of following errors like:
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libphobos2.a(thread_256_713.o): relocation R_X86_64_32 against symbol `_D6object9Throwable7__ClassZ' can not be used when making a shared object; recompile with -fPIC

Example: Using dmd 2.071 and dub; dub init appName; compile appName with dub.
Or direct with dmd

What I'm missing? Any hints?

Thanks & Regards, Ozan

November 04, 2016
On Thursday, 3 November 2016 at 14:52:26 UTC, Ozan (ONS) wrote:
> Hi,
>
> with a fresh Ubuntu 16.10 installation using "Hello, World" I got a list of following errors like:
> /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libphobos2.a(thread_256_713.o): relocation R_X86_64_32 against symbol `_D6object9Throwable7__ClassZ' can not be used when making a shared object; recompile with -fPIC
>
> Example: Using dmd 2.071 and dub; dub init appName; compile appName with dub.
> Or direct with dmd
>
> What I'm missing? Any hints?
>
> Thanks & Regards, Ozan

Solved through changing content of /etc/dmd.conf to

[Environment32]
DFLAGS=-I/usr/include/dmd/phobos -I/usr/include/dmd/druntime/import -L-L/usr/lib/i386-linux-gnu -L--export-dynamic -fPIC -defaultlib=libphobos2.so

[Environment64]
DFLAGS=-I/usr/include/dmd/phobos -I/usr/include/dmd/druntime/import -L-L/usr/lib/x86_64-linux-gnu -L--export-dynamic -fPIC -defaultlib=libphobos2.so

Thanks for the hints,
Ozan