January 21, 2014
I have used the command:

dmd -shared -defaultlib=libphobos2.so -oflibsayhello.so source/sayHello.o -L-L.

successfully on Debian Unstable using the dmd-bin and libphobos2-dev debs from d-apt. However on OSX using the dmd and phobos ports as provided via MacPorts:

dmd -shared -defaultlib=libphobos2.so -oflibsayhello.so
source/sayHello.o -L-L.
ld: library not found for -llibphobos2.so
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
--- errorlevel 1

It seems that the phobos port only installs the static archive and not the dynamic library.

I appreciate the library should probably be called libphobos2.dylib rather than libphobos2.so on OSX but that is not provided.

Thanks.

-- 
Russel. ============================================================================= Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder@ekiga.net 41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel@winder.org.uk London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder