httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From whut_jia <>
Subject Re:Re: Re: compile a file written by C++ into apache
Date Tue, 30 Nov 2010 15:12:21 GMT

At 2010-11-30 21:58:56,"Ben Noordhuis" <> wrote:

>2010/11/30 whut_jia <>:
>> In Apache2.2, I compile a c++ source file with g++ as below:
>> g++ -fPIC -shared -o mod_validate.cpp -I/usr/include/httpd -I/usr/include/apr-1
>> After it , I copy into apache module location ,and this module work
>> But now,in apache2.3,I compile this file in  the same accurs the following
>>     /apache2.3/include/http_config.h:989:error:expected ","or "..." before ‘new’
>> (In headers file ,The 989th  line is:
>> AP_DECLARE(void) ap_merge_log_config(const struct ap_logconf *old,
>>                                     struct ap_logconf *new);
>> )
>> I think there are not errors in this line ,but why can i compile it successfullly?
>new is a C++ keyword. Three solutions.
>1. Rename the parameter in http_config.h to new_conf. Bad.
>2. At the top of your source file add "#define new new_". Bad.
>3. Make your module C only. Split off the C++ code into a separate file. Good.

Hi, Noordhui,
Thank you for your reply.
Because  OpenSAML which I called is a set of open source C++ & Java libraries and large
 ,so I  want to write a module with c++ ,in which I can call the library-function directly.Can
you give me some help how I compile  module written by c++ into apache DSO file.I used apxs
tool but it failed.This tool can't compiling c++ source file???If using g++,is my directive
 correct??(g++ -fPIC -shared -o mod_validate.cpp -I/usr/include/httpd -I/usr/include/apr-1
-I/opt/opensaml/include) .
Because I am just studying apache module development, I hope get more help.Thanks for your

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message