[CMake] Compilation error when compiling with apache httpd

Cosmin Luță cosmin.luta at avira.com
Wed Aug 26 10:15:03 EDT 2009


On Wed, 26 Aug 2009 19:22:57 +0530
Rajika Kumarasiri <rajika at wso2.com> wrote:

> hello everybody,
> I have this strange error. I have a apache module which I try to
> compile using CMake. I included the required httpd headers(using a
> varible pass using -D) and ran cmake. After that I try to run make
> and I end up with the following set of errors.  I am not sure why
> this happens, the default make based build system works fine, any
> help to fix this problem is greatly appriciate. Thanks.
> 

apr requires some flags to be defined in order to compile properly. Try
adding the output of apr-config --cflags and apr-config --cppflags to 
your defines.

For example:

$ apr-config --cppflags
 -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE

$ apr-config --cflags
  -pthread

So you should try something like:

set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DLINUX=2 -D_REENTRANT
-D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread")

Hope that helps.


> 
> In file included from
> /home/rajika/installtion/httpd/install/include/ap_config.h:26,
>                  from
> /home/rajika/installtion/httpd/install/include/httpd.h:44,
>                  from
> /home/rajika/project/cmake/c/src/core/transport/http/server/apache2/mod_axis2.c:19:
> /home/rajika/installtion/httpd/install/include/apr.h:285: error:
> expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘apr_off_t’
> In file included from
> /home/rajika/installtion/httpd/install/include/apr_file_io.h:30,
>                  from
> /home/rajika/installtion/httpd/install/include/apr_network_io.h:27,
>                  from
> /home/rajika/installtion/httpd/install/include/httpd.h:54,
>                  from
> /home/rajika/project/cmake/c/src/core/transport/http/server/apache2/mod_axis2.c:19:
> /home/rajika/installtion/httpd/install/include/apr_file_info.h:198:
> error: expected specifier-qualifier-list before ‘apr_off_t’
> In file included from
> /home/rajika/installtion/httpd/install/include/apr_network_io.h:27,
>                  from
> /home/rajika/installtion/httpd/install/include/httpd.h:54,
>                  from
> /home/rajika/project/cmake/c/src/core/transport/http/server/apache2/mod_axis2.c:19:
> /home/rajika/installtion/httpd/install/include/apr_file_io.h:632:
> error: expected declaration specifiers or ‘...’ before ‘apr_off_t’
> /home/rajika/installtion/httpd/install/include/apr_file_io.h:859:
> error: expected declaration specifiers or ‘...’ before ‘apr_off_t’
> In file included from
> /home/rajika/installtion/httpd/install/include/httpd.h:54,
>                  from
> /home/rajika/project/cmake/c/src/core/transport/http/server/apache2/mod_axis2.c:19:
> /home/rajika/installtion/httpd/install/include/apr_network_io.h:550:
> error: expected declaration specifiers or ‘...’ before ‘apr_off_t’
> In file included from
> /home/rajika/installtion/httpd/install/include/apr_buckets.h:33,
>                  from
> /home/rajika/installtion/httpd/install/include/httpd.h:55,
>                  from
> /home/rajika/project/cmake/c/src/core/transport/http/server/apache2/mod_axis2.c:19:
> /home/rajika/installtion/httpd/install/include/apr_mmap.h:134: error:
> expected declaration specifiers or ‘...’ before ‘apr_off_t’
> /home/rajika/installtion/httpd/install/include/apr_mmap.h:161: error:
> expected declaration specifiers or ‘...’ before ‘apr_off_t’
> In file included from
> /home/rajika/installtion/httpd/install/include/httpd.h:55,
>                  from
> /home/rajika/project/cmake/c/src/core/transport/http/server/apache2/mod_axis2.c:19:
> /home/rajika/installtion/httpd/install/include/apr_buckets.h:242:
> error: expected specifier-qualifier-list before ‘apr_off_t’
> /home/rajika/installtion/httpd/install/include/apr_buckets.h:725:
> error: expected declaration specifiers or ‘...’ before ‘apr_off_t’
> /home/rajika/installtion/httpd/install/include/apr_buckets.h:738:
> error: expected declaration specifiers or ‘...’ before ‘apr_off_t’
> /home/rajika/installtion/httpd/install/include/apr_buckets.h:774:
> error: expected declaration specifiers or ‘...’ before ‘apr_off_t’
> /home/rajika/installtion/httpd/install/include/apr_buckets.h:910:
> error: expected declaration specifiers or ‘...’ before ‘apr_off_t’
> /home/rajika/installtion/httpd/install/include/apr_buckets.h:911:
> error: expected declaration specifiers or ‘...’ before ‘apr_off_t’
> /home/rajika/installtion/httpd/install/include/apr_buckets.h:1202:
> error: expected declaration specifiers or ‘...’ before ‘apr_off_t’
> /home/rajika/installtion/httpd/install/include/apr_buckets.h:1401:
> error: expected declaration specifiers or ‘...’ before ‘apr_off_t’
> /home/rajika/installtion/httpd/install/include/apr_buckets.h:1415:
> error: expected declaration specifiers or ‘...’ before ‘apr_off_t’
> /home/rajika/installtion/httpd/install/include/apr_buckets.h:1471:
> error: expected declaration specifiers or ‘...’ before ‘apr_off_t’
> /home/rajika/installtion/httpd/install/include/apr_buckets.h:1487:
> error: expected declaration specifiers or ‘...’ before ‘apr_off_t’
> In file included from
> /home/rajika/project/cmake/c/src/core/transport/http/server/apache2/mod_axis2.c:19:
> /home/rajika/installtion/httpd/install/include/httpd.h:858: error:
> expected specifier-qualifier-list before ‘apr_off_t’
> In file included from
> /home/rajika/installtion/httpd/install/include/http_protocol.h:35,
>                  from
> /home/rajika/project/cmake/c/src/core/transport/http/server/apache2/mod_axis2.c:22:
> /home/rajika/installtion/httpd/install/include/util_filter.h:142:
> error: expected declaration specifiers or ‘...’ before ‘apr_off_t’
> /home/rajika/installtion/httpd/install/include/util_filter.h:299:
> error: expected declaration specifiers or ‘...’ before ‘apr_off_t’
> In file included from
> /home/rajika/project/cmake/c/src/core/transport/http/server/apache2/mod_axis2.c:22:
> /home/rajika/installtion/httpd/install/include/http_protocol.h:111:
> error: expected declaration specifiers or ‘...’ before ‘apr_off_t’
> /home/rajika/installtion/httpd/install/include/http_protocol.h:203:
> error: expected declaration specifiers or ‘...’ before ‘apr_off_t’
> In file included from
> /home/rajika/project/cmake/c/src/core/transport/http/server/apache2/mod_axis2.c:24:
> /home/rajika/installtion/httpd/install/include/apr_strings.h:299:
> error: expected declaration specifiers or ‘...’ before ‘apr_off_t’
> /home/rajika/installtion/httpd/install/include/apr_strings.h:317:
> error: expected ‘)’ before ‘*’ token
> /home/rajika/installtion/httpd/install/include/apr_strings.h:353:
> error: expected ‘)’ before ‘size’
> 
> 



More information about the CMake mailing list