On Tue, Apr 7, 2009 at 03:27, Richard Langly <richard.ringo.lan...@gmail.com> 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/mod_car.so into server: > /usr/local/lib/libcar.so.0: undefined symbol: wmrelease > > I do have the libcar.so.0 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 libcar.la > lrwxrwxrwx 1 root root 14 Mar 31 19:23 libcar.so -> libcar.so.0.0.0 > lrwxrwxrwx 1 root root 14 Mar 31 19:23 libcar.so.0 -> libcar.so.0.0.0 > -rwxr-xr-x 1 root root 34109 Mar 31 19:23 libcar.so.0.0.0 > > 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/libcar.so. Run nm -uC /usr/local/lib/libcar.so | 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 elsewhere). The run ldd /usr/local/lib/libcar.so ldd lists the libs that are loaded dynamically. If you get something like libexpat.so.1 => /usr/lib/libexpat.so.1 (0xb7d65000) then it means that the dynamic lib tries loading libexpat.so.1 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/libcar.so 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. S -- 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?