Call of C function breaks memoty layout
Steven Schveighoffer
schveiguy at gmail.com
Fri Jan 24 14:57:59 UTC 2020
On 1/24/20 8:37 AM, Andrey wrote:
> Hello,
> I'm trying to bind C library for Tcl/Tk in D code. There is a function
> called "Tcl_CreateInterp()" which I declared as extent(C). When I call
> this function then layout of memory become broken - one of my global
> wstring variables loses it's value.
> I don't know why it is happens. If I comment the call - I get normal
> execution.
>
> May be somebody had faced with such problem. What to do?
>
> My code:
>> struct Tcl_Interp;
>> extern (C)
>> {
>> Tcl_Interp* Tcl_CreateInterp() nothrow;
>> }
Not used Tcl in a long time, never via D.
Have a look at https://wiki.tcl-lang.org/page/D for some instruction maybe?
-Steve
More information about the Digitalmars-d-learn
mailing list