httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Lewis <>
Subject Re: probleme with link a external library
Date Mon, 10 Mar 2008 13:35:54 GMT
mohamed nadir belkhelfa wrote:
> hello
> I am das new Web programming with the API apache1.3 and  I want to link
> static library libwarc.a that I have personally created in my program
> mod_warc.c
> For this I add to my makefile (automatically generated by apxs-g-n)the  line
> LIB = -lwarc
> the compilation has produced without problem and even the execution does not
> generate an error,
> My libraie contains several function and global variables (enum)
> The problem is that I arrived to display the content of my enum
> but  in the moment to execute the fonction "bless" (this fonction call
> malloc for allocate the memory)
> NULL is returned but this fuction ( the memory is not allocated)
> I have try to link the  library otherwise by adding the option  -Wl -lwarc
> to apxs but i have  always the same results
> I have tried to work with a dynamic library, I have compile my library with
> the option-fPIC, I create the library and
> I added makefile the line
> LIB = usr/local/lib/
> but I have the same results as when the use of the library static
> I hope that I have clearly explained the problem.  My  static and dynamic
> library running normally if I call them in a normaly C program
> Please send me examples or linking static and dynamic libraries is clearly
> shown
> Thanks

Should I respond twice since you sent the same message twice?

I suggest looking for something like a mod_auth_mysql, which uses the 
MySQL client libraries, as your example.  Pre-existing modules are 
always good.  Or, visiting and finding something like 
mod_auth_ibmdb2 and viewing the compilation package for something like 
"EXTRA_FLAGS" is always a good way.  (HINT : You can always try googling 
for rpath, which is a common Linux method for linking to 
external/dynamic libraries).  Or, since your desire is to open an so 
file, "LoadFile" may also come in handy (it's a directive in the 
configuration side of things to load an .so into the system).

Joseph Lewis <>
"Divide the fire, and you will sooner put it out." - Publius Syrus

View raw message