writing to stdout from c crashes in ide

BlitzMax Forums/BlitzMax Programming/writing to stdout from c crashes in ide

grable(Posted 2007) [#1]
Anyone else noticed this?

Ive developed a library in c for my projects, and it calls various functions to print to stdout.
Like printf, fprintf etc...

The funny thing is that when running this from inside the ide the program crashes, and sometimes even the ide itself crashes.

The resulting executables work perfectly fine outside the ide though, so im not sure whats wrong :(


Gabriel(Posted 2007) [#2]
What are you trying to achieve? If you just want to be able to write to BMax's debuglog from C, then write to StdErr. That's what I do, and that definitely works fine from the IDE for me.

Other than that, you might just be sending a character that the IDE can't handle? After all, it is the IDE that has to print the StdOut and StdErr stuff into the debuglog.


grable(Posted 2007) [#3]
Its a scripting engine im working on, its using printf to print its output...

I think i found the error btw. i register native functions, and it seems using a c function defined via an extern block and calling it from c (or assembler which i am realy doing) is what bugs.

If i register it via C it works perfectly, so its something the extern block does to the signature of the function perhaps?

<edit> this just gets wierder and wierder, if i put a Print anywhere in max code before calling any c code, it works!