PDA

View Full Version : vprintf with maya API?


schizofrantic
01-28-2010, 05:32 AM
I have a plugin for maya I am trying to debug. The problem is, sometimes the output suddenly dies in the middle.

After the millionth problem caused by using iostream in other projects I no longer use it for anything, but maya seems somehow dependent on this. If I don't use it at all I seem to recall there was some big problem like not even compiling. So the only way to get any output with vprintf at all seems to be to have a dummy cerr line in the plugin somewhere. I also have the REQUIRE_IOSTREAM part appended to my preprocessor stuff (and I think it won't compile without it, but I don't remember).

Even so, output simply cuts out some of the time for no reason. I have worked around it until now but lately it has chosen to cut out every time in the place I want to debug. The program is not hanging or anything; it returns normally, but it's not processing some of the data properly and without the debug I can't tell what's going on.

Is there some way to completely eliminate dependence on the iostream stuff? Honestly I didn't even think it was possible to make such a weird dependency.

EDIT: just to confirm, if I remove entirely then it compiles but I get no output at all when I try to use the C style stuff.

schizofrantic
01-28-2010, 06:39 AM
Ok, I feel silly now. All I needed to do was flush cerr. Then it works fine.

CGTalk Moderation
01-28-2010, 06:39 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.