Moritz Maxeiner wrote: > On Monday, 18 March 2013 at 13:50:29 UTC, Jens Mueller wrote: > >I don't know how this is done on Windows. On Linux you just set > >the > >LD_LIBRARY_PATH. > > My problem with that is that it's a) not encapsulated inside the > program and b) OS dependent.
Very true. Do you have a solution for this? I can add it to ddl, if that is the right place to put it. > >Probably. There are very few users for such a use case. > >But if you would use LLVM's plain C interface in D users who have > >used > >the API in C will feel home. I mean why expose the LLVM C API as > >an > >addition. It certainly does no harm. > > The C API will keep being exposed, of course; all I meant was that > splitting them off might not be the best idea when they mostly exist > only to be used by the D API and the C API should not be used unless > you really want/have to. And by splitting you mean in different files, right? > >Usually, I use dynamic linking. I believe you would do the same if > >optlink worked. > > Maybe if optlink had worked with COFF when I started using D (back > in D1 times), but right now, even if optlink would start working on > win32 with COFF I'd still go with runtime loading as often as > possible (Not counting D libraries with D classes in them, of > course, only C API libraries). Mostly because this way you can start > your programs with "rdmd program.d". No need to care at all about > libraries: Getting a working compilation should imho be as simple as > invoking the compiler with the source file that contains your main > (or the root file of the library to create). Extra argument are > necessary for specific configuration, but compiling should work with > the least amount of extra argument as possible. I see. > >The process is usually pretty simple. But the documentation is > >lacking. > >There are several pieces floating around. I can try writing one > >document > >and try to push it to the official web site. > > That'd be great, thank you very much. > > >Do as you like it. I do not think this is a bad approach. > > I'll to that, then. I'm currently working on the D API, but I'll try > to get the copied deimos compatible project started in the next > couple of days. Sounds good. I'm going to write the documentation this evening. Jens