Fastcgi and STL string problem - how to debug FCGX_ applications?
Jack <[email protected]>
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello pps, I'm not sure if it's conclusive that fcgi doesn't work well with STL or STL string? If it is, it would be sad. I don't mind moving to the FCGX_ interface. My concern is, doesn't it make it more difficult to debug? By using fcgi_stdio.h it's very easy to debug the app as a stand alone CGI application just by setting some environment variables in a script. I wonder how you debug with FCGX_ functions? -- Best regards, Jack Friday, September 2, 2005, 11:59:18 PM, you wrote: p> Jack wrote: >> Hello all, >> >> I experienced a problem with STL string recently. >> In one of the libraries I use, <string> is referenced >> in the header files. I can compile and run it in a console. >> The printouts looked correct. However when I ran it as fcgi >> app, I got an error 500, meaning the printouts were not being >> intercepted by fcgi. I didn't have a clue why this happened >> and had to comment out function calls to the library but this >> didn't help. Then I commented out the header file inclusions. >> The problem went away. Then I dig into the header file and comment >> out the code line by line. Eventually I find that as long as I >> have #include <string> in the library's header file, I'll get >> error 500. Then of course without that line the code won't compile. >> I then moved the inclusion of the library .h ahead of fcgi_studio.h, >> the code compiled and worked fine. It seems that <string> must be >> included before fcgi_studio.h? p> fcgi_stdio.h is probably designed that function names are re#define ed, p> so when you include <string> it somewhere includes something from p> iostreams (for operator<<) and fcgi_stdio's redefines don't work. I p> personally don't like to use fcgi_xxx with c++, and hope that for c++ p> there will be separate version without redefining standart functions p> (people may simply use std::printf(...) instead of printf(...) and it p> will not work with fcgi). For cpp there should be streambuf's to use p> fcgi with iostreams and all thouse fget, fprint etc, but defined in p> separate namespace (eg. fcgi). I wrote a simple streambuf for using fcgi p> with iostreams, but I still have some problems with it :) p> ... ___________________________________ fastcgi-developers mailing list http://fastcgi.com/fastcgi-developers/