Erro SigC

1. Erro SigC

Fabio Mattes
fabiomattes2011

(usa Slackware)

Enviado em 21/06/2011 - 15:07h

Estou seguindo uma apostila sobre programação em Gtk com c++, mas o seguinte código está me retornando erro:

#include <gtkmm.h>

class Controlador:public SigC::Object{
Gtk::Window& janela;
public:
Controlador(Gtk::Window& _janela):
janela(_janela){
Object();
janela.set_title("Cliques");
}
void botao_pressionado(){
janela.set_title(janela.get_title()+"+");
}
};
int main(int argc, char **argv){
Gtk::Main main(argc, argv);
Gtk::Window janela;
Controlador controlador(janela);
Gtk::Button botao("Clique-me");
janela.add(botao);
botao.show();

botao.signal_clicked().connect(SigC::slot(controlador, &Controlador::botao_pressionado));
Gtk::Main::run(janela);
}

estou compilando com os seguintes parametros:
g++ -o exemplo teste.cpp `pkg-config gtkmm-3.0 --cflags --libs` -v

o retorno é este:

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-pc-linux-gnu/4.6.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: /build/src/gcc-4.6-20110603/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --enable-gnu-unique-object --enable-linker-build-id --with-ppl --enable-cloog-backend=isl --enable-lto --enable-gold --enable-ld=default --enable-plugin --with-plugin-ld=ld.gold --disable-multilib --disable-libstdcxx-pch --enable-checking=release
Thread model: posix
gcc version 4.6.0 20110603 (prerelease) (GCC)
COLLECT_GCC_OPTIONS='-o' 'exemplo' '-D' 'GSEAL_ENABLE' '-pthread' '-I' '/usr/include/gtkmm-3.0' '-I' '/usr/lib/gtkmm-3.0/include' '-I' '/usr/include/atkmm-1.6' '-I' '/usr/include/giomm-2.4' '-I' '/usr/lib/giomm-2.4/include' '-I' '/usr/include/pangomm-1.4' '-I' '/usr/lib/pangomm-1.4/include' '-I' '/usr/include/gtk-3.0' '-I' '/usr/include/cairomm-1.0' '-I' '/usr/lib/cairomm-1.0/include' '-I' '/usr/include/gdk-pixbuf-2.0' '-I' '/usr/include/gtk-3.0/unix-print' '-I' '/usr/include/gdkmm-3.0' '-I' '/usr/lib/gdkmm-3.0/include' '-I' '/usr/include/atk-1.0' '-I' '/usr/include/glibmm-2.4' '-I' '/usr/lib/glibmm-2.4/include' '-I' '/usr/include/glib-2.0' '-I' '/usr/lib/glib-2.0/include' '-I' '/usr/include/sigc++-2.0' '-I' '/usr/lib/sigc++-2.0/include' '-I' '/usr/include/pango-1.0' '-I' '/usr/include/cairo' '-I' '/usr/include/pixman-1' '-I' '/usr/include/freetype2' '-I' '/usr/include/libpng14' '-pthread' '-v' '-shared-libgcc' '-mtune=generic' '-march=pentiumpro'
/usr/lib/gcc/i686-pc-linux-gnu/4.6.0/cc1plus -quiet -v -I /usr/include/gtkmm-3.0 -I /usr/lib/gtkmm-3.0/include -I /usr/include/atkmm-1.6 -I /usr/include/giomm-2.4 -I /usr/lib/giomm-2.4/include -I /usr/include/pangomm-1.4 -I /usr/lib/pangomm-1.4/include -I /usr/include/gtk-3.0 -I /usr/include/cairomm-1.0 -I /usr/lib/cairomm-1.0/include -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gtk-3.0/unix-print -I /usr/include/gdkmm-3.0 -I /usr/lib/gdkmm-3.0/include -I /usr/include/atk-1.0 -I /usr/include/glibmm-2.4 -I /usr/lib/glibmm-2.4/include -I /usr/include/glib-2.0 -I /usr/lib/glib-2.0/include -I /usr/include/sigc++-2.0 -I /usr/lib/sigc++-2.0/include -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/freetype2 -I /usr/include/libpng14 -D_GNU_SOURCE -D_REENTRANT -D GSEAL_ENABLE teste.cpp -quiet -dumpbase teste.cpp -mtune=generic -march=pentiumpro -auxbase teste -version -o /tmp/ccyVMyut.s
GNU C++ (GCC) version 4.6.0 20110603 (prerelease) (i686-pc-linux-gnu)
compiled by GNU C version 4.6.0 20110603 (prerelease), GMP version 5.0.2, MPFR version 3.0.1, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/include/gtkmm-3.0
/usr/lib/gtkmm-3.0/include
/usr/include/atkmm-1.6
/usr/include/giomm-2.4
/usr/lib/giomm-2.4/include
/usr/include/pangomm-1.4
/usr/lib/pangomm-1.4/include
/usr/include/gtk-3.0
/usr/include/cairomm-1.0
/usr/lib/cairomm-1.0/include
/usr/include/gdk-pixbuf-2.0
/usr/include/gtk-3.0/unix-print
/usr/include/gdkmm-3.0
/usr/lib/gdkmm-3.0/include
/usr/include/atk-1.0
/usr/include/glibmm-2.4
/usr/lib/glibmm-2.4/include
/usr/include/glib-2.0
/usr/lib/glib-2.0/include
/usr/include/sigc++-2.0
/usr/lib/sigc++-2.0/include
/usr/include/pango-1.0
/usr/include/cairo
/usr/include/pixman-1
/usr/include/freetype2
/usr/include/libpng14
/usr/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0
/usr/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0/i686-pc-linux-gnu
/usr/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0/backward
/usr/lib/gcc/i686-pc-linux-gnu/4.6.0/include
/usr/local/include
/usr/lib/gcc/i686-pc-linux-gnu/4.6.0/include-fixed
/usr/include
End of search list.
GNU C++ (GCC) version 4.6.0 20110603 (prerelease) (i686-pc-linux-gnu)
compiled by GNU C version 4.6.0 20110603 (prerelease), GMP version 5.0.2, MPFR version 3.0.1, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 8dafd547785cdc5dd795bed983bf1785
teste.cpp:3:26: error: ‘SigC’ has not been declared
teste.cpp:3:32: error: expected ‘{’ before ‘Object’
teste.cpp:3:38: error: invalid type in declaration before ‘{’ token
teste.cpp:3:38: warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x [enabled by default]
teste.cpp:4:14: error: expected primary-expression before ‘&’ token
teste.cpp:4:16: error: ‘janela’ was not declared in this scope
teste.cpp:4:22: error: expected ‘}’ before ‘;’ token
teste.cpp:5:1: error: expected unqualified-id before ‘public’
teste.cpp: In function ‘void botao_pressionado()’:
teste.cpp:12:5: error: ‘janela’ was not declared in this scope
teste.cpp: At global scope:
teste.cpp:14:1: error: expected declaration before ‘}’ token

Alguém poderia me explicar o porque deste erro?
desde já agradeço


  






Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts