February 28, 2014 Re: undefined symbol: rt_finalize | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tolga Cakiroglu | Whops! Hold on a sec. I saw that I defined `foo` as `extern` instead of `export`. Testing with that. |
February 28, 2014 Re: undefined symbol: rt_finalize | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tolga Cakiroglu | 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 |
February 28, 2014 Re: undefined symbol: rt_finalize | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tolga Cakiroglu | 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?
|
February 28, 2014 Re: undefined symbol: rt_finalize | ||||
---|---|---|---|---|
| ||||
Posted in reply to evilrat | 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 |
February 28, 2014 Re: undefined symbol: rt_finalize | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tolga Cakiroglu | On Friday, 28 February 2014 at 06:45:25 UTC, Tolga Cakiroglu wrote: > 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 http://dlang.org/dll-linux.html#dso7 dmd lib.d -shared -fPIC -debug -gc -g -w -wi -defaultlib=libphobos2.so |
February 28, 2014 Re: undefined symbol: rt_finalize | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stanislav Blinov | >
> http://dlang.org/dll-linux.html#dso7
>
> dmd lib.d -shared -fPIC -debug -gc -g -w -wi -defaultlib=libphobos2.so
Problem about using shared libphobos is that I need to install many different libraries on the target computer. On the web server, I don't want to install DMD. I compiled before a DLL with libphobos2.so, and on web server it started asking many different libraries which made me unhappy.
|
Copyright © 1999-2021 by the D Language Foundation