apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maxim <ma...@red-pyramid.com>
Subject Cannot link APR library with MinGW
Date Wed, 02 Mar 2005 08:31:53 GMT
Has anyone use APR library (http://apr.apache.org) with your application 
for Win32 with MinGW?

First, I tried compiling APR library with MinGW but got the same error 
about shared memory allocation support:

checking for mmap... no
checking for munmap... no
checking for shm_open... no
checking for shm_unlink... no
checking for shmget... no
checking for shmat... no
checking for shmdt... no
checking for shmctl... no
checking for create_area... no
checking for MAP_ANON in sys/mman.h... no
checking for /dev/zero... yes
./configure:Error: decision on anonymous shared memory allocation method 
failed

Second, I tried use binary files from APR and Apache tarballs for Win32 
(compiled with MSVC).
I followed by instructions on this page 
http://mingw.org/mingwfaq.shtml#faq-msvcdll , but they can't help me, 
linking proccess continue issue "undefined reference to ..."

My decision of this problem was extract import library (.a) from
libapr.dll  and link it in my application. My steps:

- Create two .def files (One with __cdecl functions and second
with __stdcall functions). They are:
  1. libapr-c.def
  -------Content---------
  LIBRARY libapr.dll
  EXPORTS
  apr_app_init_complete DATA
  apr_day_snames DATA
  apr_dbg_log
  apr_file_printf
  apr_month_snames DATA
  ...
  -----------------------
  2. libapr-s.def
  -------Content---------
  LIBRARY libapr.dll
  EXPORTS
  _apr_accept@12
  _apr_allocator_alloc@8
  _apr_allocator_create@4
  _apr_allocator_destroy@4
  _apr_allocator_free@8
  ...

  -Create two import libs , using these commands:

  	dlltool -U --input-def libapr-s.def -l libapr-s.a
	dlltool --input-def libapr-c.def -l libapr-c.a

-Then, i link these libs to my app. Linking finished well  		without 
errors. But,there were errors at runtime.

After recompiling libapr-c.a (with __stdcall funcs) with new
def file (i add alias for every function):
------------------
LIBRARY libapr.dll
EXPORTS
apr_accept = _apr_accept@12
_apr_accept@12 = _apr_accept@12
...
------------------
there are'n runtime errors , but only for __stdcall function. :(

__cdecl functions continue call errors at runtime.
And a can't to solve this problem.







Mime
View raw message