Re: g_message and g_warning under Windows



Richard Gipps writes:
stream = freopen("error.log","w",stderr);

g_message("g_message_test");
fprintf(stderr,"fprintf_test");

which sits in the init function for my main window class.  The fprintf 
statement works fine, but the g_message() function seems to do nothing.

Hmm, sorry, actually what's needed is not freopen() but a
dup2(). gmessages.c in 2.6 doesn't use stdio on Windows any longer,
but plain write() to file descriptor 1 or 2, like on Unix.

I.e. something like

fd = open ("error.log", O_WRONLY);
dup2 (fd, 2);
g_message ("blah\n");

should work, I hope.

--tml





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]