httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sorin Manolache <>
Subject Re: linking problem
Date Tue, 07 Apr 2009 07:22:54 GMT
On Tue, Apr 7, 2009 at 03:27, Richard Langly
<> wrote:
> Hi all,
> I've written an small hello world like module and compiled it as such.
>        sudo apxs -lcar -ci ./mod_car.c
> But when I try to start it, I get the following error ...
>        $ /etc/init.d/apache2 start
>         * apache2 has detected a syntax error in your configuration files:
>        apache2: Syntax error on line 154 of /etc/apache2/httpd.conf: Syntax
> error on line 4 of /etc/apache2/modules.d/30_mod_car.conf: Cannot load
> /usr/lib64/apache2/modules/ into server:
> /usr/local/lib/ undefined symbol: wmrelease
> I do have the files here ...
> $ ls -l libcar.*
> -rw-r--r-- 1 root root 41034 Mar 31 19:23 libcar.a
> -rwxr-xr-x 1 root root   834 Mar 31 19:23
> lrwxrwxrwx 1 root root    14 Mar 31 19:23 ->
> lrwxrwxrwx 1 root root    14 Mar 31 19:23 ->
> -rwxr-xr-x 1 root root 34109 Mar 31 19:23
> I can't tell where the wmrelease is coming from.
> Anyone see what I'm doing wrong?

Yeah, you're not a believer :-).

Joke apart. Obviously the undefined symbol is referred by
/usr/local/lib/ Run

nm -uC /usr/local/lib/ | less

and search for wmrelease to confirm that it is referred there and
undefined (nm lists the names (symbols) in a binary. -u lists the
undefined symbols (referred from the file and hopefully defined

The run
ldd /usr/local/lib/

ldd lists the libs that are loaded dynamically. If you get something like => /usr/lib/ (0xb7d65000)

then it means that the dynamic lib tries loading which
it locates in /usr/lib.

What I suppose that goes wrong in your case is that wmrelease is
defined in a lib that is not in the standard path where libs are
searched. Try ldd /usr/local/lib/ and check if all libs are
resolved. (Resolved = you get a file name on the right hand side of

If all libs are resolved, then make sure that apache knows where to
search for them.

If there are unresolved libs, you have to find the location where
wmrelease is defined. Try google, my hunch after scanning the google
search results is that wmrelease belongs to some tk libraries.

Once you identified where the lib that defines wmrelease is located on
the disk, you make it available to apache:

Either you run as root ldconfig dir-name (read man ldconfig) or you
add the dir to the environment variable LD_LIBRARY_PATH. You have to
export that library and to start apache in the shell where you
exported the variable.

On some apache installations (on Debian for example), there is a file
called /etc/apache2/envvars where one can add environment variables
that should be added to apache's environment.


A: Because it reverses the logical flow of conversation.
Q: Why is top-posting frowned upon?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

View raw message