httpd-modules-dev mailing list archives

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

At 2010-11-30 20:57:24,"Ben Noordhuis" <> wrote:

>2010/11/30 whut_jia <>:
>> I write a module by C++ supporting the generation of SAML assertion, so in my  module
I called the OpenSAML Library.The question is how I compile this source file written by c++
language into my apache server.
>Like you compile any mixed project: define a function in your C++ code
>with C linkage[1] and call it from your C code. Compile .c and .cc
>files to object files, then link them into a shared object.
>apxs2 probably won't be much help here, it doesn't seem to handle C++
>source files (at least, it never does in my projects).
>[1] extern "C" void entrypoint(void *data) { /* ... */ }

Thank you for your replay,
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 well.
But now,in apache2.3,I compile this file in  the same accurs the following error,
     /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?
Thank you,
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message