View previous topic :: View next topic |
Author |
Message |
hugues
Joined: 09 Aug 2007 Posts: 20 Location: Brussels, Belgium
|
Posted: Fri Aug 10, 2007 8:21 pm Post subject: Newbie question: is DDL right for me? |
|
|
Hi,
I'm planning to create a multi-platform (at least GNU/Linux, Mac OS X and Windows) application in D. One of its key characteristics is that it will be built on modules (plug-ins). Ideally, functionalities more advanced than just normal shared libraries would be desirable. Is DDL the right choice for me? Does it work with gdc? |
|
Back to top |
|
|
h3r3tic
Joined: 30 Mar 2004 Posts: 261 Location: Torun, Poland
|
Posted: Sat Aug 11, 2007 5:16 am Post subject: |
|
|
As far as I can tell, DDL will only work for dmd/windows right now. My suggestion would be that you use DDL on dmd/windows and load standard so/dylibs on linux and mac. Windows DLLs have some terrible problems which DDL avoids, but shared libraries on linux (and on mac, I believe) aren't that bad, but they lack the reflection features. So you'd have to opt for the feature set that linux shared libs give and get that from DDL on windows.
edit: DDL doesn't work with gdc on windows, because it outputs COFF binaries, while DDL only correctly supports OMF at the moment. |
|
Back to top |
|
|
hugues
Joined: 09 Aug 2007 Posts: 20 Location: Brussels, Belgium
|
Posted: Sat Aug 11, 2007 11:46 am Post subject: Any dynamic lib example with gdc? |
|
|
Thanks for this quick reply. I already made some dynamic library tests with gdc on Mac OS X. I used the ExeModule class. Calling a simple function that does a writefln() works OK, but any attempt to create an object with new throws a bus error. When run in gdb, I get the following message:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x0009efca in _d_newclass ()
Do you know of any dynamic lib example with gdc on Mac OS X and GNU/Linux?
Is there a portable way of doing dynamic libraries without having to write platform-specific code? |
|
Back to top |
|
|
h3r3tic
Joined: 30 Mar 2004 Posts: 261 Location: Torun, Poland
|
Posted: Sat Aug 11, 2007 11:56 am Post subject: |
|
|
I'm not very much of a linux person, not to mention mac I haven't even compiled a single .so in linux with D ... But some folks have! If you joined #d at freenode, I'm sure some folks would be able to help. GregorR seems to be good at compiler and linker stuff on linux, so it would probably pay off to bug him a bit |
|
Back to top |
|
|
|