echo-cpp.cpp fails with a linker error

Thomas Rowe <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
I cannot compile the echo-cpp.cpp example:
http://www.fastcgi.com/devkit/examples/echo-cpp.cpp
I get a linker error.

I would really like to use c++ streams rather than printf.  I am not
especially experienced in C or C++, so I have not been able to diagnose the
error.  Please help.

I am running the Debian Sarge linux distribution with g++ version 3.3.5 and
the latest fastcgi.

It appears that line 118 - 120 in echo-cpp.cpp cause the failure.

---------
$ g++ -lfcgi echo-cpp.cpp -o echo
/tmp/ccmD8dSR.o(.text+0x237): In function `main':
: undefined reference to
`fcgi_streambuf::fcgi_streambuf[in-charge](FCGX_Stream*)'
/tmp/ccmD8dSR.o(.text+0x24c): In function `main':
: undefined reference to
`fcgi_streambuf::fcgi_streambuf[in-charge](FCGX_Stream*)'
/tmp/ccmD8dSR.o(.text+0x261): In function `main':
: undefined reference to
`fcgi_streambuf::fcgi_streambuf[in-charge](FCGX_Stream*)'
/tmp/ccmD8dSR.o(.text+0x418): In function `main':
: undefined reference to `fcgi_streambuf::~fcgi_streambuf [in-charge]()'
/tmp/ccmD8dSR.o(.text+0x42e): In function `main':
: undefined reference to `fcgi_streambuf::~fcgi_streambuf [in-charge]()'
/tmp/ccmD8dSR.o(.text+0x44a): In function `main':
: undefined reference to `fcgi_streambuf::~fcgi_streambuf [in-charge]()'
/tmp/ccmD8dSR.o(.text+0x460): In function `main':
: undefined reference to `fcgi_streambuf::~fcgi_streambuf [in-charge]()'
/tmp/ccmD8dSR.o(.text+0x47c): In function `main':
: undefined reference to `fcgi_streambuf::~fcgi_streambuf [in-charge]()'
/tmp/ccmD8dSR.o(.text+0x49e): more undefined references to
`fcgi_streambuf::~fcgi_streambuf [in-charge]()' follow
collect2: ld returned 1 exit status

___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.