Thread: Problem with using libsigc++

  1. #1
    Registered User
    Join Date
    May 2007
    Posts
    6

    Problem with using libsigc++

    Hello all,

    i'm trying to get a program run with libsigc++. As startup i went through the walkthrough there and sort of used this tutorialpart for the program: http://libsigc.sourceforge.net/libsi...html/ch03.html

    Here is the code:

    myFeedback.h
    Code:
    #include <iostream>
    #include <string>
    #include "sigc++/object.h"
    #include "sigc++/signal.h"
    
    using namespace std;
    
    class myFeedback : public SigC::Object
    {
    
    	public:
    	//Constructer and Destructor
    	myFeedback();
    	~myFeedback();
    
    	void setFeedback(string);
    
    
    	sigc::signal<void> upData;
    	sigc::signal<void> upWarning;
    
    };

    myFeedback.c
    Code:
    #include "myFeedback.h"
    
    
    //******************************************************************
    // Constructor and Destructor
    //******************************************************************
    BehaviorRealizerFeedback() {};
    ~BehaviorRealizerFeedback() {};
    
    
    void setFeedback(string mydata)
    {
    	if (mydata == "data")
    	{
    		//store the data before emitting a signal
    		upData.emit();
    	}
    	else if (mydata == "warning")
    	{
    		//store the warning before emitting a signal
    		upWarning.emit();
    	}
    	else
    	{
    		cout << "Unknown Feedbacktype named " << type << " ." <<endl;
    	};
    
    };
    It is not a standalone program, but trying to compile the project (this file), i get the error that the signals are "not declared in this scope" within "setFeedback", but i declared the signals in the header, like in the example in the tutorial. Anyone got some help?

    Thank you
    Hork83

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    > myFeedback.c
    I thought this was supposed to be a C++ program (not a C program).

    What exact compile command line and error message did you get?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM