Dynamically calling external libraries.
Setra
roederharpo at hushmail.com
Thu Feb 27 13:46:16 PST 2014
By returns I ment what it wrote to the screen. I realise now that
that was a bad word to use... Every time I run it I get the value
134515512. Here is my compile script (Note I edited my code to
use the same method of printing that you did and got the same
result):
dmd -c dll.d -fPIC
dmd -oflibdll.so dll.o -shared -defaultlib=libphobos2.so
-L-rpath=/path/to/where/shared/library/is
dmd -c main.d
dmd main.o -L-ldl -defaultlib=libphobos2.so
-L-rpath=.:/path/to/where/shared/library/is -map
./main
Thanks!
More information about the Digitalmars-d-learn
mailing list