Forums » Development »
[Solved] Using our own C files in a lighttpd plugin
Added by matdakillah over 14 years ago
Hi,
I've modified mod_accesslog.c and want to use function in my own C file.
I've puted the include of my header file in the mod_accesslog.c file, I've modify the src/Makefile.am to add my C and H files respectively in common_src and hdr part, but the problem appear when I launch lighty with this error :
2009-08-25 11:56:37: (plugin.c.165) dlopen() failed for: /usr/local/lib/mod_accesslog.so /usr/local/lib/mod_accesslog.so: undefined symbol: get_domain
2009-08-25 11:56:37: (server.c.621) loading plugins finally failed
The function get_domain is in my own C file placed in src folder.
I don't know how to fix it and I don't want to put all this functions in mod_accesslog.c
Thx for helping me.
Replies (1)
RE: [Solved] Using our own C files in a lighttpd plugin - Added by gstrauss about 7 years ago
mod_accesslog.c needs to #include <yourfile.h>
yourfile.h needs to export the function prototype for get_domain()
yourfile.c should define an extern function get_domain(), not 'static' scope.