RE: [sigc] compile error



Well, yes, that constructor is not defined. Neither is run(). I'm not sure
that it's supposed to actually compile. It should be easy to fix.

Murray Cumming
murrayc usa net
www.murrayc.com 

> -----Original Message-----
> From: Mattheos Kakaris [mailto:m kakaris chello nl] 
> Sent: Mittwoch, 9. Juli 2003 16:44
> To: libsigc-list gnome org
> Subject: [sigc] compile error
> 
> 
> While reading chapter 2. Connecting your code to signals from the
> libsigc++ documentation:
> http://libsigc.sourceforge.net/libsigc1_2/manual/html/ch02.htm
> l#id2773405
> 
> I tried to compile the simple example by using the instructions at the
> bottom of the page:
> 
> g++ example1.cc -o eg1 `pkg-config --cflags --libs sigc++-1.2`
> 
> 
> I get the following error message:
> 
> /tmp/ccXfsmCT.o(.text+0x47): In function `main':
> : undefined reference to `AlienDetector::AlienDetector[in-charge]()'
> /tmp/ccXfsmCT.o(.text+0xbb): In function `main':
> : undefined reference to `AlienDetector::run()'
> collect2: ld returned 1 exit status
> 
> 
> for reference purposes here is my complete code:
>  
> #include <iostream>
> #include <sigc++/sigc++.h>
> 
> #ifdef SIGC_CXX_NAMESPACES
> using namespace std;
> using namespace SigC;
> #endif
> 
> 
> class AlienDetector
> {
> public:
>     AlienDetector();
> 
>     void run();
> 
>     SigC::Signal0<void> detected;
> };
> 
> void warn_people()
> {
>     cout << "There are aliens in the carpark!" << endl;
> }
> 
> int main()
> {
>    AlienDetector mydetector;
>    mydetector.detected.connect( SigC::slot(warn_people) );
> 
>    mydetector.run();
> 
>     return 0;
> }
> 
> Please can someone tell me what I need to do to properly compile the
> code.
> 
> kind regards
> Mattheos
> 
> _______________________________________________
> libsigc-list mailing list
> libsigc-list gnome org
> http://mail.gnome.org/mailman/listinfo/libsigc-list
> 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]