Help passing D strings to C libs

Daniel Green venix1 at gmail.com
Mon Mar 14 00:04:25 PDT 2011


On 3/14/2011 2:55 AM, Gene P. Cross wrote:
> I haven't a debugger at the moment, could you recommend one ?
Sorry, I use GDB with GDC.  I don't know about DMD, it may work with GDB 
on linux.  You could try installing GDC and see if the results are the 
same.  That may help to rule out the compiler itself.

> I also made the string a char[] and tested to see if that made a difference.
That also requires using some of the previous examples to append '\0' first.

> I think it may be something to do with SDL itself. I tried calling another
> function, SDL_GetTicks(), and that's causing problems as well.
Can you install a program that uses SDL and are you running 64-bit? 
Could be possible you're trying to call a 64-bit function from 32-bit code.

> I read the docs earlier and found the same thing about literals being null
> terminated but not regular strings,
Every suggestion so far should take care of that issue.



More information about the Digitalmars-d-learn mailing list