FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Newbie question: is DDL right for me?

 
Post new topic   Reply to topic     Forum Index -> DDL - D Dynamic Libraries
View previous topic :: View next topic  
Author Message
hugues



Joined: 09 Aug 2007
Posts: 20
Location: Brussels, Belgium

PostPosted: Fri Aug 10, 2007 8:21 pm    Post subject: Newbie question: is DDL right for me? Reply with quote

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
View user's profile Send private message
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Sat Aug 11, 2007 5:16 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
hugues



Joined: 09 Aug 2007
Posts: 20
Location: Brussels, Belgium

PostPosted: Sat Aug 11, 2007 11:46 am    Post subject: Any dynamic lib example with gdc? Reply with quote

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
View user's profile Send private message
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Sat Aug 11, 2007 11:56 am    Post subject: Reply with quote

I'm not very much of a linux person, not to mention mac Wink I haven't even compiled a single .so in linux with D Embarassed ... 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 Cool
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DDL - D Dynamic Libraries All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group