Re: [OBORONA-SPAM] Fastcgi and STL string problem

pps <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
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?
> 
>




fcgi_stdio.h is probably designed that function names are re#define ed, 
so when you include <string> it somewhere includes something from 
iostreams (for operator<<) and fcgi_stdio's redefines don't work. I 
personally don't like to use fcgi_xxx with c++, and hope that for c++ 
there will be separate version without redefining standart functions 
(people may simply use std::printf(...) instead of printf(...) and it 
will not work with fcgi). For cpp there should be streambuf's to use 
fcgi with iostreams and all thouse fget, fprint etc, but defined in 
separate namespace (eg. fcgi). I wrote a simple streambuf for using fcgi 
with iostreams, but I still have some problems with it :)
...
___________________________________
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.