You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Abdul Mujeer Kapadia <mu...@uffaq.com> on 2003/12/12 08:35:52 UTC
C++ compilation issue with command_rec
Hi,
I am developing an Apache module in C++ and have come across this issue
that I am unable to resolve even after hours of effort. I will
appreciate any idea/suggestion to resolve this.
When compiling with g++, the compiler gives the following error at the
directives declaration (command_rec)
"invalid conversion from `const char*(*)(cmd_parms*, void*, const char*)
' to `const char*(*)()'"
I have tried many workarounds including shifting directive declaration
outside class structure, but it appears g++ doesn't like the underlying
code. I have also tried following the macros in http_config.h, but have
been unable to come up with a workable solution to resolve this problem.
Open to any suggestion/idea.
Thanks
A. Mujeer
Re: C++ compilation issue with command_rec
Posted by Cliff Woolley <jw...@virginia.edu>.
On Thu, 11 Dec 2003, Abdul Mujeer Kapadia wrote:
> "invalid conversion from `const char*(*)(cmd_parms*, void*, const char*)
> ' to `const char*(*)()'"
Yeah, C++ doesn't like that kind of cast. Which is very annoying, but oh
well. Not as annoying as some of the other things C++ won't let you do.
:-)
Anyway, why can't you just add an #ifdef __cplusplus block to the header
file and change the command_rec to have the correct kind of prototype for
the function pointer in question?
--Cliff