开发者

Issues in using 3rd party libraries while developing Apache Modules

开发者 https://www.devze.com 2023-01-03 20:36 出处:网络
I am writing an Apache modulefor my internship. I am using C for this (I am not acquainted with Perl or Python that much).

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_开发者_Go百科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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消