
wswillianss
(usa Ubuntu)
Enviado em 22/12/2008 - 08:26h
Olá, estou com um problema aqui. Estou com todas as bibliotecas instaladas do Glade e Libglade e o GCC insiste em dizer que o "pkg-config --cflags --libs libglade-2.0" não é reconhecido. Já no Python eles são reconhecidos. Porque? Abaixo vai o código fonte:
#include <gtk/gtk.h>
#include <glade/glade.h>
int main(int argc,char *argv[])
{
GladeXML *xml;
gtk_init(&argc, &argv);
xml = glade_xml_new("hello.glade",NULL,NULL);
glade_xml_signal_autoconnect(xml);
gtk_main();
return 0;
}
... o arquivo glade
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
<!--Generated with glade3 3.4.5 on Mon Dec 22 05:55:36 2008 -->
<glade-interface>
<widget class="GtkWindow" id="winJanela">
<property name="title" translatable="yes">Hello World</property>
<property name="window_position">GTK_WIN_POS_CENTER</property>
<signal name="destroy" handler="gtk_main_quit"/>
<child>
<placeholder/>
</child>
</widget>
</glade-interface>
.... o comando de compilação
gcc ${pkg-config --cflags --libs libglade-2.0} hello.c -o hello
... e aqui o ERRO
willian@ubuntu:~/devs/hello$ gcc 'pkg-config --cflags --libs' hello.c -o hello
gcc: pkg-config --cflags --libs: Arquivo ou diretório inexistente
hello.c:1:21: error: gtk/gtk.h: Arquivo ou diretório inexistente
hello.c:2:25: error: glade/glade.h: Arquivo ou diretório inexistente
hello.c: In function ‘main’:
hello.c:6: error: ‘GladeXML’ undeclared (first use in this function)
hello.c:6: error: (Each undeclared identifier is reported only once
hello.c:6: error: for each function it appears in.)
hello.c:6: error: ‘xml’ undeclared (first use in this function)
hello.c:9: error: ‘NULL’ undeclared (first use in this function)