LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 12-21-2009, 07:18 AM   #1
skiman1979
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.

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

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

class MyClass
{
public:
        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
 
  


Reply



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++, slackbuilds.org vinegaroon Slackware 0 05-21-2009 12:50 AM
libsigc++ not installed. deanmeyer Red Hat 18 06-05-2004 09:26 PM
problems with libsigc-1.0.so.0 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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:32 AM.

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