Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Module compile error

Status
Not open for further replies.

imazing103

Technical User
Dec 9, 2007
2
US
Hi,
i'm a newbie to apache. When i tried to compile a module given in the following link under the heading "Adding a custom header" i got the following error. How do i rectify the error ?

$ /usr/sbin/apxs -c my_mod.c -o my_mod.dll
gcc -DCYGWIN -DNO_DBM_REWRITEMAP -DUSE_HSREGEX -DEAPI -DPIC -DSHARED_CORE -O2 -D
SHARED_MODULE -I/usr/include/apache -c my_mod.c
gcc -g --shared -o my_mod.dll my_mod.o -o my_mod.dll /bin/cyghttpd2core.dll
my_mod.o:my_mod.c: (.text+0x26): undefined reference to `__imp__ap_table_set'
collect2: ld returned 1 exit status
apxs:Break: Command failed with rc=1
 
The actual code is

#include "httpd.h"
#include "http_config.h"

module MODULE_VAR_EXPORT my_header_module;

static int my_header_fixup(request_rec *r) {
ap_table_set(r->headers_out, "X-My-Header", "this is my header");
return OK;
}

module MODULE_VAR_EXPORT my_header_module = {
STANDARD_MODULE_STUFF,
NULL, /* initializer */
NULL, /* dir config creator */
NULL, /* dir config merger */
NULL, /* server config */
NULL, /* merge server config */
NULL, /* command table */
NULL, /* handlers */
NULL, /* filename translation */
NULL, /* check_user_id */
NULL, /* check auth */
NULL, /* check access */
NULL, /* type_checker */
my_header_fixup, /* fixups */
NULL, /* logger */
NULL, /* header parser */
NULL, /* child_init */
NULL, /* child_exit */
NULL /* post read-request */
};
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top