October 04, 2012 Re: how to call std_stdio_static_this from a dynamically loaded shared library (osx) | ||||
---|---|---|---|---|
| ||||
Posted in reply to timotheecour | On 2012-10-04 20:13, timotheecour wrote: > I'm fine with that (and already doing this, to call Runtime.initialize), > but that doesn't solve the issue of this thread. No, not if you need to redefine functions. -- /Jacob Carlborg |
October 04, 2012 Re: how to call std_stdio_static_this from a dynamically loaded shared library (osx) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | On Thursday, 4 October 2012 at 19:20:54 UTC, Jacob Carlborg wrote: > On 2012-10-04 20:13, timotheecour wrote: > >> I'm fine with that (and already doing this, to call Runtime.initialize), >> but that doesn't solve the issue of this thread. > No, not if you need to redefine functions. Even if I don't need to redefine: As I was explaining in the first post, my original problem was that calling the existing (non-templated, non-modified) extern(C) std_stdio_static_this() seems to have no effect: a call to writeln(0) will cause a runtime crash in the shared lib. Even after a call to Runtime.initialize. So far, only adding a templated version std_stdio_static_this2()() and calling it allows writeln(0) to work. I wish somebody had an explanation why std_stdio_static_this() doesn't work but std_stdio_static_this2()() works. |
October 05, 2012 Re: how to call std_stdio_static_this from a dynamically loaded shared library (osx) | ||||
---|---|---|---|---|
| ||||
Posted in reply to timotheecour | On 2012-10-04 21:30, timotheecour wrote: > Even if I don't need to redefine: > > As I was explaining in the first post, my original problem was that > calling the existing (non-templated, non-modified) extern(C) > std_stdio_static_this() seems to have no effect: a call to writeln(0) > will cause a runtime crash in the shared lib. Yes, that's what how I understood it. Do you want to do both? > Even after a call to Runtime.initialize. So far, only adding a templated > version std_stdio_static_this2()() and calling it allows writeln(0) to > work. > > I wish somebody had an explanation why std_stdio_static_this() doesn't > work but std_stdio_static_this2()() works. I have no idea. Do you have a small test case to show, including how you compiled it? -- /Jacob Carlborg |
Copyright © 1999-2021 by the D Language Foundation