www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Compilation phobos errors with DMD 2.071,2.072 or dub

reply Ozan (ONS) <ozan.nurettin.sueel gmail.com> writes:
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
Nov 03 2016
next sibling parent kozzi11 via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
--8323328-1155843618-1478194860=:1186
Content-Type: TEXT/plain; CHARSET=UTF-8
Content-Transfer-Encoding: QUOTED-PRINTABLE

Really? This issue is here on forum many times, can you pleas read last few=
 post? Just by name.=0A=0ASent from my Samsung device.=C2=A0=0A=0A=0A=0A=0A=
=0A---- Original message ----=0AFrom: Ozan (ONS) via Digitalmars-d-learn <d=
igitalmars-d-learn puremagic.com>=0ASent: 03/11/2016 15:55:24=0ATo: digital=
mars-d-learn puremagic.com=0ASubject: Compilation phobos errors with DMD 2.=
071,2.072 or dub=0A=0A=0A=0AHi,=0A=0A=0A=0Awith=C2=A0a=C2=A0fresh=C2=A0Ubun=
tu=C2=A016.10=C2=A0installation=C2=A0using=C2=A0"Hello,=C2=A0World"=C2=A0I=
=C2=A0got=C2=A0=0A=0Aa=C2=A0list=C2=A0of=C2=A0following=C2=A0errors=C2=A0li=
ke:=0A=0A/usr/bin/ld:=C2=A0=0A=0A/usr/lib/x86_64-linux-gnu/libphobos2.a(thr=
ead_256_713.o):=C2=A0=0A=0Arelocation=C2=A0R_X86_64_32=C2=A0against=C2=A0sy=
mbol=C2=A0=0A=0A`_D6object9Throwable7__ClassZ'=C2=A0can=C2=A0not=C2=A0be=C2=
=A0used=C2=A0when=C2=A0making=C2=A0a=C2=A0=0A=0Ashared=C2=A0object;=C2=A0re=
compile=C2=A0with=C2=A0-fPIC=0A=0A=0A=0AExample:=C2=A0Using=C2=A0dmd=C2=A02=
.071=C2=A0and=C2=A0dub;=C2=A0dub=C2=A0init=C2=A0appName;=C2=A0compile=C2=A0=
=0A=0AappName=C2=A0with=C2=A0dub.=0A=0AOr=C2=A0direct=C2=A0with=C2=A0dmd=0A=
=0A=0A=0AWhat=C2=A0I'm=C2=A0missing?=C2=A0Any=C2=A0hints?=0A=0A=0A=0AThanks=
=C2=A0&=C2=A0Regards,=C2=A0Ozan=0A=0A=0A=0A=0A

--8323328-1155843618-1478194860=:1186
Content-Type: TEXT/html; CHARSET=UTF-8
Content-Transfer-Encoding: QUOTED-PRINTABLE

<html><body><div dir=3D"auto">Really? This issue is here on forum many time=
s, can you pleas read last few post? Just by name.<br><br><div dir=3D"auto"=
 class=3D"tizen_signature">Sent from my Samsung device.</div>&nbsp;</div>=
=0A=0A=0A=0A=0A=0A<div class=3D"tizen_quote">---- Original message ----<br>=
From: Ozan (ONS) via Digitalmars-d-learn &lt;digitalmars-d-learn puremagic.=
com&gt;<br>Sent: 03/11/2016 15:55:24<br>To: digitalmars-d-learn puremagic.c=
om<br>Subject: Compilation phobos errors with DMD 2.071,2.072 or dub<br></d=
iv><br>=0A=0AHi,=0A<br>=0A<br>with&nbsp;a&nbsp;fresh&nbsp;Ubuntu&nbsp;16.10=
&nbsp;installation&nbsp;using&nbsp;"Hello,&nbsp;World"&nbsp;I&nbsp;got&nbsp=
;=0A<br>a&nbsp;list&nbsp;of&nbsp;following&nbsp;errors&nbsp;like:=0A<br>/us=
r/bin/ld:&nbsp;=0A<br>/usr/lib/x86_64-linux-gnu/libphobos2.a(thread_256_713=
.o):&nbsp;=0A<br>relocation&nbsp;R_X86_64_32&nbsp;against&nbsp;symbol&nbsp;=
=0A<br>`_D6object9Throwable7__ClassZ'&nbsp;can&nbsp;not&nbsp;be&nbsp;used&n=
bsp;when&nbsp;making&nbsp;a&nbsp;=0A<br>shared&nbsp;object;&nbsp;recompile&=
nbsp;with&nbsp;-fPIC=0A<br>=0A<br>Example:&nbsp;Using&nbsp;dmd&nbsp;2.071&nbsp;and&nbsp;d=
ub;&nbsp;dub&nbsp;init&nbsp;appName;&nbsp;compile&nbsp;=0A<br>appName&nbsp;=
with&nbsp;dub.=0A<br>Or&nbsp;direct&nbsp;with&nbsp;dmd=0A<br>=0A<br>What&nb=
sp;I'm&nbsp;missing?&nbsp;Any&nbsp;hints?=0A<br>=0A<br>Thanks&nbsp;&amp;&nb=
sp;Regards,&nbsp;Ozan=0A<br>=0A<br><br></body></html>

--8323328-1155843618-1478194860=:1186--
Nov 03 2016
prev sibling parent Ozan (ONS) <ozan.nurettin.sueel gmail.com> writes:
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
Nov 04 2016