View mode: basic / threaded / horizontal-split · Log in · Help
May 10, 2012
Runtime.loadLibrary() on Linux
Is it possible?

I get a message "rt_loadLibrary() not supported on Posix" when I 
try. Is there something I'm doing wrong or is loading shared 
libraries not supported at all on Linux systems?

thanks.
May 10, 2012
Re: Runtime.loadLibrary() on Linux
I should not I've only tried with DMD (so far). I'll try with LDC 
and GDC in the morning.
May 10, 2012
Re: Runtime.loadLibrary() on Linux
On 2012-05-10 09:09, F i L wrote:
> Is it possible?
>
> I get a message "rt_loadLibrary() not supported on Posix" when I try. Is
> there something I'm doing wrong or is loading shared libraries not
> supported at all on Linux systems?
>
> thanks.

No, not using "rt_loadLibrary". You can still use the good old C 
function "dlopen". I think "rt_loadLibrary" does some extra stuff that 
the corresponding Windows function for "dlopen" doesn't do for shared D 
libraries.

-- 
/Jacob Carlborg
May 10, 2012
Re: Runtime.loadLibrary() on Linux
On Thursday, 10 May 2012 at 11:11:14 UTC, Jacob Carlborg wrote:
> On 2012-05-10 09:09, F i L wrote:
>> Is it possible?
>>
>> I get a message "rt_loadLibrary() not supported on Posix" when 
>> I try. Is
>> there something I'm doing wrong or is loading shared libraries 
>> not
>> supported at all on Linux systems?
>>
>> thanks.
>
> No, not using "rt_loadLibrary". You can still use the good old 
> C function "dlopen". I think "rt_loadLibrary" does some extra 
> stuff that the corresponding Windows function for "dlopen" 
> doesn't do for shared D libraries.

Ah, thank you. That set me on the right track.
May 11, 2012
Re: Runtime.loadLibrary() on Linux
On Thursday, 10 May 2012 at 07:09:43 UTC, F i L wrote:
> Is it possible?
>
> I get a message "rt_loadLibrary() not supported on Posix" when 
> I try. Is there something I'm doing wrong or is loading shared 
> libraries not supported at all on Linux systems?

It should be made to work on Linux.  Interested in submitting a
pull request?  The function is in src/rt/dmain2.d.
May 11, 2012
Re: Runtime.loadLibrary() on Linux
On 11-05-2012 20:46, Sean Kelly wrote:
> On Thursday, 10 May 2012 at 07:09:43 UTC, F i L wrote:
>> Is it possible?
>>
>> I get a message "rt_loadLibrary() not supported on Posix" when I try.
>> Is there something I'm doing wrong or is loading shared libraries not
>> supported at all on Linux systems?
>
> It should be made to work on Linux. Interested in submitting a
> pull request? The function is in src/rt/dmain2.d.

Isn't it just a matter of dlopen on most (if not all) POSIX impls?

-- 
- Alex
May 11, 2012
Re: Runtime.loadLibrary() on Linux
Sean Kelly wrote:
> It should be made to work on Linux.  Interested in submitting a
> pull request?  The function is in src/rt/dmain2.d.

alexrp beat me to it:

https://github.com/D-Programming-Language/dmd/pull/941
https://github.com/D-Programming-Language/druntime/pull/211
Top | Discussion index | About this forum | D home