How to use D for cross platform development?

Bennie Copeland mugen.kanosei at gmail.com
Sun Mar 25 04:12:40 PDT 2012


Hello all. I'm sorry if this has been addressed before.

For a little background. I've been studying C++ with the 
intention of doing cross platform work on Windows, OSX, and 
eventually iOS and some other mobile OSes. My plan was to write 
cross platform shared libraries for the core functionality and 
implement the GUI using Win32, Cocoa, etc. Well, while C++ is 
powerful, I'm finding it a beast to work with. I kept thinking 
about abandoning C++ altogether and using C# with Mono until I 
stumbled upon D. D sounds exactly like what I am looking for, 
powerful yet productive and native.

My question however is how to do D cross platform development. I 
can't seem to find any recent information about it. From what I 
have gathered so far it seems, shared libraries are possible on 
win/osx/linux, but only when linked against other D code. For 
linking against C, I can create a DLL in windows, but I can't 
create an .so in linux, and no information at all about OSX. Some 
of the information I found is years old and I can't tell if the 
situation has changed. There is nothing in the FAQ about 
libraries. And googling provides little information.

So, is it possible to write the core of an application in a cross 
platform D library that can be callable by C, C++, or Objective-C 
to provide the GUI elements?
If not, is it possible to write a C wrapper around the library 
that is then callable by C, C++ or Objective-C?
How have others approached this situation?
Besides the library issues, what other issues or gotchas should I 
look out for in regards to cross platform development?


More information about the Digitalmars-d mailing list