Apache Module compile error

Discussion in 'Apache' started by imd, Dec 10, 2007.

  1. #1
    Hi,
    i'm a newbie to apache. When i tried to compile a simple module i got the following error. How do i rectify the error ?

    //Code

    #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 */
    };

    //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
     
    imd, Dec 10, 2007 IP
  2. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #2
    joebert, Dec 15, 2007 IP