views:

25

answers:

1

Hello everyone!

I am writing an Apache module for my internship. I am using C for this (I am not acquainted with Perl or Python that much).

I need to use an HTML Parser to solve the problem for which I am writing this module. I am considering libxml2 for this purpose.

I am confused how should I link the library in my module ? Should I link the library while compiling the module OR Should I use the LoadFile directive in the configuration file to load the library.

My main concern is that while I am developing this on Ubuntu, but I don't know what will be the OS running on the deployment server. So I want its deployment, complications free and successful.

EDIT: @Grim: thanks for replying :)

I compiled the module with the following commands:

apxs -I /usr/include/libxml2/ -c mod_xmltest.c

sudo apxs -n xmltest_module -i mod_xmltest.la

I believe this does not link the libraries in the module, I was getting "Unresolved Symbols" error when starting the server, so I used the LoadFile directive to load libxml2 library. It seems to work.

Do you think there can be any issues this way? I think this makes my module more portable, as on the deployment server the admin can explicitly specify the location of the libxml2 library.

+1  A: 

You should link the library while compiling your module.

There are of course the usual portability issues (at least then it comes to a non-posix OS). In this case some of them are solved by apxc. It's impossible to say which complications that might occur, but nothing of what you describe should cause any.

Grim