undefined symbol: rt_finalize

Tolga Cakiroglu tcak at pcak.com
Thu Feb 27 22:45:24 PST 2014


On Friday, 28 February 2014 at 06:40:27 UTC, evilrat wrote:
> On Friday, 28 February 2014 at 06:36:02 UTC, Tolga Cakiroglu 
> wrote:
>> On Friday, 28 February 2014 at 06:28:10 UTC, Tolga Cakiroglu 
>> wrote:
>>> Whops! Hold on a sec. I saw that I defined `foo` as `extern` 
>>> instead of `export`. Testing with that.
>>
>> Even Walter Bright's code doesn't use export, and goes with 
>> extern only.
>> http://dlang.org/dll-linux.html#dso10
>
> that articles may be outdated. export has some problems in 
> terms it was implemented recently, and still not on all 
> platforms.
>
> also, why are you calling gcc to make .so ? isn't dmd with 
> -shared not works? or maybe if you really need gcc it is 
> requires to link with phobos and/or runtime if any?

If I don't use GCC, and use a build code as below, following is 
the error of compiler:

dmd lib.d -shared -fPIC -debug -gc -g -w -wi
/usr/bin/ld: 
/usr/lib/x86_64-linux-gnu/libphobos2.a(lifetime_46f_7db.o): 
relocation R_X86_64_32 against `_D15TypeInfo_Shared7__ClassZ' can 
not be used when making a shared object; recompile with -fPIC
/usr/lib/x86_64-linux-gnu/libphobos2.a: error adding symbols: Bad 
value
collect2: error: ld returned 1 exit status
--- errorlevel 1
make: *** [libnogcc] Error 1




More information about the Digitalmars-d-learn mailing list