Re: How to use std. packages in so files written in dlang

2016-08-11 Thread ketmar via Digitalmars-d-learn
On Friday, 12 August 2016 at 03:41:54 UTC, bachmeier wrote: On Friday, 12 August 2016 at 03:31:37 UTC, ketmar wrote: On Friday, 12 August 2016 at 03:20:59 UTC, grampus wrote: Didn't realise the D community is such active. yes, we are. while we may be not very huge in number, we are very pass

Re: How to use std. packages in so files written in dlang

2016-08-11 Thread bachmeier via Digitalmars-d-learn
On Friday, 12 August 2016 at 03:31:37 UTC, ketmar wrote: On Friday, 12 August 2016 at 03:20:59 UTC, grampus wrote: Didn't realise the D community is such active. yes, we are. while we may be not very huge in number, we are very passionate about our language of choice. ;-) Currently there ar

Re: How to use std. packages in so files written in dlang

2016-08-11 Thread ketmar via Digitalmars-d-learn
On Friday, 12 August 2016 at 03:20:59 UTC, grampus wrote: Didn't realise the D community is such active. yes, we are. while we may be not very huge in number, we are very passionate about our language of choice. ;-)

Re: How to use std. packages in so files written in dlang

2016-08-11 Thread grampus via Digitalmars-d-learn
On Friday, 12 August 2016 at 02:31:29 UTC, ketmar wrote: On Friday, 12 August 2016 at 01:36:34 UTC, grampus wrote: [...] then you have to check if runtime is initialized at the start of each function that can be called from C side. like this: [...] Understand, I will be careful here. Than

Re: How to use std. packages in so files written in dlang

2016-08-11 Thread ketmar via Digitalmars-d-learn
On Friday, 12 August 2016 at 01:36:34 UTC, grampus wrote: I can use dlang in this existing project as long as nothing can be changed on the C side. then you have to check if runtime is initialized at the start of each function that can be called from C side. like this: private void ensureRu

Re: How to use std. packages in so files written in dlang

2016-08-11 Thread grampus via Digitalmars-d-learn
On Friday, 12 August 2016 at 01:45:29 UTC, Mike Parker wrote: On Friday, 12 August 2016 at 01:36:34 UTC, grampus wrote: On Friday, 12 August 2016 at 01:09:47 UTC, ketmar wrote: On Friday, 12 August 2016 at 00:57:42 UTC, grampus wrote: it's 'cause you didn't initialized druntime. you have to us

Re: How to use std. packages in so files written in dlang

2016-08-11 Thread Mike Parker via Digitalmars-d-learn
On Friday, 12 August 2016 at 01:36:34 UTC, grampus wrote: On Friday, 12 August 2016 at 01:09:47 UTC, ketmar wrote: On Friday, 12 August 2016 at 00:57:42 UTC, grampus wrote: it's 'cause you didn't initialized druntime. you have to use dlsym to get "rt_init" function and call it right after loa

Re: How to use std. packages in so files written in dlang

2016-08-11 Thread Mike Parker via Digitalmars-d-learn
On Friday, 12 August 2016 at 00:57:42 UTC, grampus wrote: Hi,erveryone I am trying to use dLang to make so file for existing c/c++ project. I followed the examples on https://dlang.org/dll-linux.html, which works well. but when I replaced import core.stdc.stdio; with import std.stdio; to us

Re: How to use std. packages in so files written in dlang

2016-08-11 Thread grampus via Digitalmars-d-learn
On Friday, 12 August 2016 at 01:09:47 UTC, ketmar wrote: On Friday, 12 August 2016 at 00:57:42 UTC, grampus wrote: it's 'cause you didn't initialized druntime. you have to use dlsym to get "rt_init" function and call it right after loading your .so, but before calling any other API from it.

Re: How to use std. packages in so files written in dlang

2016-08-11 Thread ketmar via Digitalmars-d-learn
On Friday, 12 August 2016 at 00:57:42 UTC, grampus wrote: it's 'cause you didn't initialized druntime. you have to use dlsym to get "rt_init" function and call it right after loading your .so, but before calling any other API from it. also, note that druntime is using SIGUSR1 and SIGUSR2 for

How to use std. packages in so files written in dlang

2016-08-11 Thread grampus via Digitalmars-d-learn
Hi,erveryone I am trying to use dLang to make so file for existing c/c++ project. I followed the examples on https://dlang.org/dll-linux.html, which works well. but when I replaced import core.stdc.stdio; with import std.stdio; to use writefln() instead of printf(), then things changed. compi