I don't know if I'll be able to help, but will try this weekend..
D.
Send me an email when you start and I'll give you the most updated information. I have new leads for the cerr stuff:
1) This is apparently related to dynamic linkage. I'm attaching a sample program to this email that illustrates the problem. I've confirmed that adding a get_cerr() function to liboctave would solve the problem. (Well, I don't know what happens if several dll's are involved...)
2) I'm guessing there's some black magic way of doing it directly with the unmodified dll, but I don't know.
3) The window popping up briefly can be fixed by replacing -Wl,-subsystem,windows with -Wl,-subsystem,console
This will force Windows to open a console for my app and keep it opened. I think I know how to fix this more elegantly, but that'll have to wait.