You are not logged in.
Hi everybody, I have a little bit trouble with linking libglade, I really dont know and dont have any idea where is problem, for testing, I have written simple hello world programm, in glade i have created hello world dialogue, i have copied xml file and create main.c :
#include <stdio.h>
#include <gtk/gtk.h>
#include <glade/glade.h>
GladeXML *xml;
int main (int argc, char **argv) {
GtkWidget *app1;
gtk_init (&argc, &argv);
xml = glade_xml_new ("hello.glade", NULL, NULL);
glade_xml_signal_autoconnect (xml);
glade_xml_get_widget(xml, "app1");
gtk_widget_show(app1);
gtk_main ();
return 0;
}Then I made easy makefile
CC=gcc
CFLAGS=-g -W -Wall `pkg-config --cflags`
LIBS=`pkg-config --libs`
TARGET=hello
OBJECTS=main.o
$(TARGET): $(OBJECTS)
$(CC) -o $@ $^ $(LIBS)
clean:
rm -f *.o *~ $(TARGET) *.bakSo I have run it, and ...
main.c:6:25: error: glade/glade.h: no such file or directory
main.c:8: error: syntax error before '*' token
main.c:8: warning: type defaults to 'int' in declaration of 'xml'
main.c:8: warning: data definition has no type or storage class
main.c: In function 'main':
main.c:16: warning: implicit declaration of function 'glade_xml_new'
main.c:16: warning: assignment makes pointer from integer without a cast
main.c:17: warning: implicit declaration of function 'glade_xml_signal_autoconne ct'
main.c:19: warning: implicit declaration of function 'glade_xml_get_widget'I know this is a typical bad linking error, but I have linked it with libglade as you can see in a makefile. When I try use libglade-config instead of pkg-config I got some errors.
Do you have any suggestions?
Nothing is perfect, just Linux and me :-D
Offline
Try adding:
-I/usr/include
to your compile line.
Offline
Thank for post, but I have tried before and now again, the absolutely same error :-(
Nothing is perfect, just Linux and me :-D
Offline
`pkg-config --cflags libglade-2.0` and `pkg-config --libs libglade-2.0`
Offline