Dynamically calling external libraries.

Marc Schütz" <schuetzm at gmx.net> Marc Schütz" <schuetzm at gmx.net>
Fri Feb 28 10:05:12 PST 2014


On Friday, 28 February 2014 at 17:29:09 UTC, Setra wrote:
> I am using  dmd_2.065.0-0_i386.deb on a 32 bit machine.

Ah, I can reproduce it with 32bit executables:

# dmd -m32 main1.d -L-ldl
# dmd -m32 -c dll.d -fPIC
# dmd -m32 -oflibdll.so dll.o -shared -defaultlib=
# LD_LIBRARY_PATH=. ./main1
+main()
libdll.so is loaded
dll() function is found
dll()
134684056
unloading libdll.so
-main()
# file ./main1
./main1: ELF 32-bit LSB executable, Intel 80386, version 1 
(SYSV), dynamically linked (uses shared libs), for GNU/Linux 
2.6.16, BuildID[sha1]=a0eb9b8af3a95d0c4fddd2daf7a476aabed4b53e, 
not stripped

Might be a compiler bug...


More information about the Digitalmars-d-learn mailing list