Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 12-21-2009, 07:18 AM   #1
LQ Newbie
Registered: Dec 2009
Location: Earth
Distribution: My distro changes somewhat often. I've used Gentoo, Ubuntu, Mandrake, Red Hat, and others.
Posts: 4

Rep: Reputation: 0
libsigc++ on Ubuntu - won't compile

Hi all,

Does anyone have any experience with libsigc++ (1.2 or 2.0) on Linux?

I'm currently working on a C++ console application (using Eclipse) that has a few classes and I wanted to enable certain classes to raise events back to event handlers in main.cpp. I came across libsigc++-2.0 but am having problems actually using it.

It installs just fine on my Ubuntu 9.04 box (both the runtime and dev packages) but I'm not sure what to actually #include in my source code. I tried following the tutorial on the libsigc++ site (Chapter 2. Connecting your code to signals) but it doesn't give any information on what libsigc++ headers I need.

I think I narrowed it down to #include <sigc++-2.0/sigc++/signals.h>, but I am getting hundreds of compiler errors similar to " '_A_a1_' was not declared in this scope" referencing signal.h.

Following is some code for my class header. I haven't put anything into the implementation file yet, or main.cpp.

#include <pthread>
#include <stdlib>
#include <iostream>
#include <fstream>
using namespace std;

#include <sigc++-2.0/sigc++/signal.h>

class MyClass
        virtual ~MyClass();

        sigc::signal<void,int> MySignal1;
        sigc::signal<void,int> MySignal2;

        void WaitForSomething();  //reads certain files and triggers events
My intent was in WaitForSomething() to execute MySignal1.emit() (or MySignal2.emit()), which would be connected to OnMySignalX functions in main.cpp, but that part hasn't been written yet.

On a side note: For some reason, if I remove 'int' from the MySignal1 or MySignal2 declaration (e.g., sigc::signal<void> MySignal1;, the compiler tells me I have an invalid entry for argument 2. I thought signal was supposed to be a wrapper so only the first argument (the template's return type) is required.

Last edited by XavierP; 01-21-2010 at 01:49 PM. Reason: Moved to Programming


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
libsigc++, vinegaroon Slackware 0 05-21-2009 12:50 AM
libsigc++ not installed. deanmeyer Red Hat 18 06-05-2004 09:26 PM
problems with dragonlinux Linux - Software 1 10-18-2003 07:56 AM
Problems with libsigc++ Ismark Linux - Newbie 0 12-19-2001 02:29 PM
Installing libsigc++ javanek Linux - Software 1 11-13-2001 10:48 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:38 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration