Click to See Complete Forum and Search --> : gtk programming........help


mr_ss
06-20-2001, 03:23 AM
I write a small program that displays window on the screen using gtk.
i am using Linux 6.2.
The code is like..

#include<gtk/gtk.h>

int main(int argc,char *argv[])
{
GtkWidget *window;

gtk_init(&argc, &argv);
window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_show (window);
gtk_main ();
return(0);
}//main
when i compiled it with

g++ jtest.cpp -o jtest 'gtk-config --cflags --libs'

The error is :

g++: gtk-config --cflags --libs: No such file or directory
in file included from /usr/include/gdk/gdktypes.h:33
/usr/include/gdk/gdk.h:31
/usr/include/gtk/gtk.h:31
from jtest.cpp:3
/usr/include/glib.h:66 glibconfig.h: No such file or directory.


Any help will be highly appreciated...

binaryDigit
06-20-2001, 04:03 AM
gtk is primarily used with c. i notice your using g++.
if you want to use c++ with gtk. check the gtk site for the c++ wrapper
otherwise use gcc not g++

i don't know if that will help or not.

lsibn
06-20-2001, 10:39 AM
Originally posted by binaryDigit:
<STRONG>gtk is primarily used with c. i notice your using g++.
if you want to use c++ with gtk. check the gtk site for the c++ wrapper
otherwise use gcc not g++

i don't know if that will help or not.</STRONG>
No, I thought something about that, but right now g++ can be used instead of gcc in every case- as it will produce larger binaries, but so far C++ is only beginning to fall behind C in compatibility. Using g++ should not affect it at all.

What I see is the problem is, is in glib- you probably have an old version (or on debian systems, glib-dev and glib are probably seperate packages... grr... And yes I know it's "the right thing(tm)."). My advice is to recompile and reinstall glib. I think right now the newest stable version is 1.2.10.