Re: sigc undefined?
- From: Murray Cumming <murrayc murrayc com>
- To: Joe Van Dyk <joevandyk gmail com>
- Cc: gtkmm-list gnome org
- Subject: Re: sigc undefined?
- Date: Sat, 13 May 2006 23:13:19 +0200
On Sat, 2006-05-13 at 13:28 -0700, Joe Van Dyk wrote:
> I guess I'm doing something stupid, but dunno what it could be.
> Running this on Ubuntu Dapper. Why isn't sigc not declared? Did I
> not install something correctly?
>
> joe laptop:~/projects/gtkmm/hello_world$ g++ main.cpp `pkg-config
> gtkmm-2.0 sigc++-2.0 --cflags --libs ` -o hello
Your example uses the gtkmm-2.4 API. But you are linking (or attempting
to link) to the gtkmm-2.0 API.
In neither case should you need to also specify libsigc++.
> main.cpp: In constructor 'Hello_World::Hello_World()':
> main.cpp:20: error: 'sigc' has not been declared
> main.cpp:20: error: 'mem_fun' was not declared in this scope
>
>
> joe laptop:~/projects/gtkmm/hello_world$ cat main.cpp
>
> #include <gtkmm/main.h>
> #include <gtkmm/button.h>
> #include <gtkmm/window.h>
> #include <sigc++/sigc++.h>
> #include <iostream>
>
> class Hello_World : public Gtk::Window
> {
> public:
> Hello_World();
> void on_button_clicked();
> Gtk::Button button_;
> };
>
> Hello_World::Hello_World()
> : button_("Hello World")
> {
> set_border_width(10);
> button_.signal_clicked().connect(sigc::mem_fun(*this,
> &Hello_World::on_button_clicked));
> add(button_);
> show_all();
> }
>
> void Hello_World::on_button_clicked()
> {
> std::cout << "Hello World" << std::endl;
> }
>
> int main(int argc, char *argv[])
> {
> Gtk::Main kit(argc, argv);
> Hello_World hello;
> Gtk::Main::run(hello);
> }
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
--
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]