Re: one question about glib



However when I use g_io_channel_reda_chars(channel,out,-1,&bytes_read,NULL) to get the standard out stored 
in out, it turns out to be wrong.

In what way is it wrong? A successful run of gcc to compile and link a
program produces no output.

  gchar *cmd_line[] = {"gcc","-o","temp.exe","temp.c","-mms-bitfields", "-lgtk-win32-2.0", 
"-lgdk-win32-2.0", "-latk-1.0", "-lgdk_pixbuf-2.0", "-lpangowin32-1.0", "-lgdi32" ,"-lpango-1.0" 
,"-lgobject-2.0" ,"-lgmodule-2.0", "-lglib-2.0" ,"-lintl"};

You forget the terminating NULL element in the argv.

Also, are you sure that gcc will find the GTK+ headers and libraries?
You don't pass any -I and -L flags. If you have copied the GTK+ stack
headers and libraries into your mingw installation (so that gcc and ld
will find them without any -I and -L options), I would say that is a
bad idea. Better to keep stuff from different distributions separate
and not copy headers and libraries around.

And in general, instead of manually constructing (or hardcoding) the
correct -I, -L and -l options, just use pkg-config.

--tml



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