Re: echo-cpp.cpp fails with a linker error
Thomas Rowe <[email protected]>
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Jun 20, 2006 at 10:02:54AM +0200, Basile STARYNKEVITCH wrote: > Le Sat, Jun 17, 2006 at 11:39:25PM -0400, Thomas Rowe écrivait/wrote: > > 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 > > Should be at least > g++ -Wall -O echo-cpp.cpp -lfcgi -o echo.fcgi > Maybe some -I or -L arguments (with appropriate directories) are missing; > put then before the source file. > > You definitely should learn more about C++ & linux compilation and linking > http://tldp.org/HOWTO/Program-Library-HOWTO/index.html > http://tldp.org/HOWTO/Programming-Languages.html > > > http://fastcgi.com/fastcgi-developers/ > > > The problem was that the -l option must be -lfcgi++ for C++. You are correct that this was basically a problem of my ignorance, but an example Makefile in the examples folder would probably prevent this question from being asked again. I'm sure I'm not the first idiot to be confused. ___________________________________ fastcgi-developers mailing list http://fastcgi.com/fastcgi-developers/