apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Myers, Gary - 43" <gary.my...@rainhail.com>
Subject Using apr from Mingw
Date Mon, 09 Jul 2007 17:59:08 GMT
I'm attempting to use APR in a mingw C project that I am working on to
add a layer of abstraction so I can later port in to Linux.
I've compiled the libapr.dll using Visual Studio C++ 2005 Express
edition. (Which may be my problem, I simply may not be able to make it
work using mingw gcc)
When I go to compile the simple little application using 
gcc -Wall -std=c99 -g -Ilib -Iinclude -c ./src/RuntimeMain.c
I get many errors.  It looks as though I've not included something
correctly in my source.  I've placed the source for the offending files
and the errors at the bottom of this message.
 
Any help would be appreciated.

//RuntimeMain.c
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdlib.h>
 
//apr includes
#include "apr_errno.h"
#include "apr_general.h"
 
static void closeapr(void);
 

int main(int argc, char **argv) 
{
   openConfiguration("JavaJNI.conf");
 
   if(apr_initialize() == APR_SUCCESS)
   {
      atexit(closeapr);
   
   
   }
   else
      fprintf(stderr, "Unable to initialize APR");

   
   closeConfiguration();
   
   return 0;
}
static void closeapr(void)
{
    apr_terminate();
}
 

Errors:
In file included from ./src/RuntimeMain.c:1:
lib/apr_errno.h:52: error: syntax error before "apr_strerror"
lib/apr_errno.h:53: error: syntax error before "apr_size_t"
lib/apr_errno.h:53: warning: type defaults to `int' in declaration of
`apr_strerror'
lib/apr_errno.h:53: warning: data definition has no type or storage
class
In file included from lib/apr_general.h:29,
                 from ./src/RuntimeMain.c:2:
lib/apr_pools.h:157: error: syntax error before "apr_pool_initialize"
lib/apr_pools.h:157: warning: type defaults to `int' in declaration of
`apr_pool_initialize'
lib/apr_pools.h:157: warning: data definition has no type or storage
class
lib/apr_pools.h:165: error: syntax error before "apr_pool_terminate"
lib/apr_pools.h:165: warning: type defaults to `int' in declaration of
`apr_pool_terminate'
lib/apr_pools.h:165: warning: data definition has no type or storage
class
In file included from lib/apr_pools.h:172,
                 from lib/apr_general.h:29,
                 from ./src/RuntimeMain.c:2:
lib/apr_allocator.h:49: error: syntax error before "apr_uint32_t"
lib/apr_allocator.h:49: warning: no semicolon at end of struct or union
lib/apr_allocator.h:50: warning: type defaults to `int' in declaration
of `free_index'
lib/apr_allocator.h:50: warning: data definition has no type or storage
class
lib/apr_allocator.h:53: error: syntax error before '}' token
lib/apr_allocator.h:66: error: syntax error before
"apr_allocator_create"
lib/apr_allocator.h:66: warning: type defaults to `int' in declaration
of `apr_allocator_creat
lib/apr_allocator.h:66: warning: data definition has no type or storage
class
lib/apr_allocator.h:74: error: syntax error before
"apr_allocator_destroy"
lib/apr_allocator.h:74: warning: type defaults to `int' in declaration
of `apr_allocator_destr
lib/apr_allocator.h:74: warning: data definition has no type or storage
class
lib/apr_allocator.h:82: error: syntax error before "apr_allocator_alloc"
lib/apr_allocator.h:83: error: syntax error before "apr_size_t"
lib/apr_allocator.h:83: warning: type defaults to `int' in declaration
of `apr_allocator_alloc
lib/apr_allocator.h:83: warning: data definition has no type or storage
class
lib/apr_allocator.h:90: error: syntax error before "apr_allocator_free"
lib/apr_allocator.h:91: warning: type defaults to `int' in declaration
of `apr_allocator_free'
lib/apr_allocator.h:91: warning: data definition has no type or storage
class
In file included from lib/apr_pools.h:172,
                 from lib/apr_general.h:29,
                 from ./src/RuntimeMain.c:2:
lib/apr_allocator.h:106: error: syntax error before
"apr_allocator_owner_set"
lib/apr_allocator.h:107: warning: type defaults to `int' in declaration
of `apr_allocator_owne
lib/apr_allocator.h:107: warning: data definition has no type or storage
class
lib/apr_allocator.h:110: error: syntax error before
"apr_allocator_set_owner"
lib/apr_allocator.h:111: warning: type defaults to `int' in declaration
of `apr_allocator_set_
lib/apr_allocator.h:111: warning: data definition has no type or storage
class
lib/apr_allocator.h:117: error: syntax error before
"apr_allocator_owner_get"
lib/apr_allocator.h:117: warning: type defaults to `int' in declaration
of `apr_allocator_owne
lib/apr_allocator.h:117: warning: data definition has no type or storage
class
lib/apr_allocator.h:120: error: syntax error before
"apr_allocator_get_owner"
lib/apr_allocator.h:121: warning: type defaults to `int' in declaration
of `apr_allocator_get_
lib/apr_allocator.h:121: warning: data definition has no type or storage
class
lib/apr_allocator.h:129: error: syntax error before
"apr_allocator_max_free_set"
lib/apr_allocator.h:130: error: syntax error before "apr_size_t"
lib/apr_allocator.h:130: warning: type defaults to `int' in declaration
of `apr_allocator_max_
lib/apr_allocator.h:130: warning: data definition has no type or storage
class
lib/apr_allocator.h:133: error: syntax error before
"apr_allocator_set_max_free"
lib/apr_allocator.h:134: error: syntax error before "apr_size_t"
lib/apr_allocator.h:134: warning: type defaults to `int' in declaration
of `apr_allocator_set_
lib/apr_allocator.h:134: warning: data definition has no type or storage
class
In file included from lib/apr_general.h:29,
                 from ./src/RuntimeMain.c:2:
lib/apr_pools.h:185: error: syntax error before "apr_pool_create_ex"
lib/apr_pools.h:188: warning: type defaults to `int' in declaration of
`apr_pool_create_ex'
lib/apr_pools.h:188: warning: data definition has no type or storage
class
lib/apr_pools.h:206: error: syntax error before
"apr_pool_create_ex_debug"
lib/apr_pools.h:210: warning: type defaults to `int' in declaration of
`apr_pool_create_ex_deb
lib/apr_pools.h:210: warning: data definition has no type or storage
class
lib/apr_pools.h:255: error: syntax error before "apr_pool_allocator_get"
lib/apr_pools.h:255: warning: type defaults to `int' in declaration of
`apr_pool_allocator_get
lib/apr_pools.h:255: warning: data definition has no type or storage
class
lib/apr_pools.h:265: error: syntax error before "apr_pool_clear"
lib/apr_pools.h:265: warning: type defaults to `int' in declaration of
`apr_pool_clear'
lib/apr_pools.h:265: warning: data definition has no type or storage
class
lib/apr_pools.h:280: error: syntax error before "apr_pool_clear_debug"
lib/apr_pools.h:281: warning: type defaults to `int' in declaration of
`apr_pool_clear_debug'
lib/apr_pools.h:281: warning: data definition has no type or storage
class
lib/apr_pools.h:294: error: syntax error before "apr_pool_destroy"
lib/apr_pools.h:294: warning: type defaults to `int' in declaration of
`apr_pool_destroy'
lib/apr_pools.h:294: warning: data definition has no type or storage
class
lib/apr_pools.h:309: error: syntax error before "apr_pool_destroy_debug"
lib/apr_pools.h:310: warning: type defaults to `int' in declaration of
`apr_pool_destroy_debug
lib/apr_pools.h:310: warning: data definition has no type or storage
class
lib/apr_pools.h:328: error: syntax error before "apr_palloc"
lib/apr_pools.h:328: error: syntax error before "apr_size_t"
lib/apr_pools.h:328: warning: type defaults to `int' in declaration of
`apr_palloc'
lib/apr_pools.h:328: warning: data definition has no type or storage
class
lib/apr_pools.h:338: error: syntax error before "apr_palloc_debug"
lib/apr_pools.h:338: error: syntax error before "apr_size_t"
lib/apr_pools.h:339: warning: type defaults to `int' in declaration of
`apr_palloc_debug'
lib/apr_pools.h:339: warning: data definition has no type or storage
class
lib/apr_pools.h:366: error: syntax error before "apr_pcalloc_debug"
lib/apr_pools.h:366: error: syntax error before "apr_size_t"
lib/apr_pools.h:367: warning: type defaults to `int' in declaration of
`apr_pcalloc_debug'
lib/apr_pools.h:367: warning: data definition has no type or storage
class
lib/apr_pools.h:387: error: syntax error before "apr_pool_abort_set"
lib/apr_pools.h:388: warning: type defaults to `int' in declaration of
`apr_pool_abort_set'
lib/apr_pools.h:388: warning: data definition has no type or storage
class
lib/apr_pools.h:391: error: syntax error before "apr_pool_set_abort"
lib/apr_pools.h:392: warning: type defaults to `int' in declaration of
`apr_pool_set_abort'
lib/apr_pools.h:392: warning: data definition has no type or storage
class
lib/apr_pools.h:399: error: syntax error before "apr_pool_abort_get"
lib/apr_pools.h:399: warning: type defaults to `int' in declaration of
`apr_pool_abort_get'
lib/apr_pools.h:399: warning: data definition has no type or storage
class
lib/apr_pools.h:402: error: syntax error before "apr_pool_get_abort"
lib/apr_pools.h:402: warning: type defaults to `int' in declaration of
`apr_pool_get_abort'
lib/apr_pools.h:402: warning: data definition has no type or storage
class
lib/apr_pools.h:409: error: syntax error before "apr_pool_parent_get"
lib/apr_pools.h:409: warning: type defaults to `int' in declaration of
`apr_pool_parent_get'
lib/apr_pools.h:409: warning: data definition has no type or storage
class
lib/apr_pools.h:412: error: syntax error before "apr_pool_get_parent"
lib/apr_pools.h:412: warning: type defaults to `int' in declaration of
`apr_pool_get_parent'
lib/apr_pools.h:412: warning: data definition has no type or storage
class
lib/apr_pools.h:421: error: syntax error before "apr_pool_is_ancestor"
lib/apr_pools.h:421: warning: type defaults to `int' in declaration of
`apr_pool_is_ancestor'
lib/apr_pools.h:421: warning: data definition has no type or storage
class
lib/apr_pools.h:428: error: syntax error before "apr_pool_tag"
lib/apr_pools.h:428: warning: type defaults to `int' in declaration of
`apr_pool_tag'
lib/apr_pools.h:428: warning: data definition has no type or storage
class
lib/apr_pools.h:453: error: syntax error before "apr_pool_userdata_set"
lib/apr_pools.h:457: warning: type defaults to `int' in declaration of
`apr_pool_userdata_set'
lib/apr_pools.h:457: warning: data definition has no type or storage
class
lib/apr_pools.h:478: error: syntax error before "apr_pool_userdata_setn"
lib/apr_pools.h:482: warning: type defaults to `int' in declaration of
`apr_pool_userdata_setn
lib/apr_pools.h:482: warning: data definition has no type or storage
class
lib/apr_pools.h:490: error: syntax error before "apr_pool_userdata_get"
lib/apr_pools.h:491: warning: type defaults to `int' in declaration of
`apr_pool_userdata_get'
lib/apr_pools.h:491: warning: data definition has no type or storage
class
lib/apr_pools.h:510: error: syntax error before
"apr_pool_cleanup_register"
lib/apr_pools.h:514: warning: type defaults to `int' in declaration of
`apr_pool_cleanup_regis
lib/apr_pools.h:514: warning: data definition has no type or storage
class
lib/apr_pools.h:524: error: syntax error before "apr_pool_cleanup_kill"
lib/apr_pools.h:525: warning: type defaults to `int' in declaration of
`apr_pool_cleanup_kill'
lib/apr_pools.h:525: warning: data definition has no type or storage
class
lib/apr_pools.h:534: error: syntax error before
"apr_pool_child_cleanup_set"
lib/apr_pools.h:538: warning: type defaults to `int' in declaration of
`apr_pool_child_cleanup
lib/apr_pools.h:538: warning: data definition has no type or storage
class
lib/apr_pools.h:547: error: syntax error before "apr_pool_cleanup_run"
lib/apr_pools.h:550: warning: type defaults to `int' in declaration of
`apr_pool_cleanup_run'
lib/apr_pools.h:550: warning: data definition has no type or storage
class
lib/apr_pools.h:556: error: syntax error before "apr_pool_cleanup_null"
lib/apr_pools.h:556: warning: type defaults to `int' in declaration of
`apr_pool_cleanup_null'
lib/apr_pools.h:556: warning: data definition has no type or storage
class
lib/apr_pools.h:565: error: syntax error before
"apr_pool_cleanup_for_exec"
lib/apr_pools.h:565: warning: type defaults to `int' in declaration of
`apr_pool_cleanup_for_e
lib/apr_pools.h:565: warning: data definition has no type or storage
class
In file included from ./src/RuntimeMain.c:2:
lib/apr_general.h:132: error: syntax error before "size_t"
lib/apr_general.h:163: error: syntax error before "size_t"
lib/apr_general.h:179: error: syntax error before "apr_initialize"
lib/apr_general.h:179: warning: type defaults to `int' in declaration of
`apr_initialize'
lib/apr_general.h:179: warning: data definition has no type or storage
class
lib/apr_general.h:193: error: syntax error before "apr_app_initialize"
lib/apr_general.h:195: warning: type defaults to `int' in declaration of
`apr_app_initialize'
lib/apr_general.h:195: warning: data definition has no type or storage
class
lib/apr_general.h:206: error: syntax error before "apr_terminate"
lib/apr_general.h:206: warning: type defaults to `int' in declaration of
`apr_terminate'
lib/apr_general.h:206: warning: data definition has no type or storage
class
lib/apr_general.h:217: error: syntax error before "apr_terminate2"
lib/apr_general.h:217: warning: type defaults to `int' in declaration of
`apr_terminate2'
lib/apr_general.h:217: warning: data definition has no type or storage
class
make: *** [RuntimeMain.o] Error 1


Mime
View raw message