2014-02-10 1 views
0

아파치 모듈을 컴파일 할 때 알 수없는 유형 이름 모듈 오류가 발생합니다. 어떻게해야합니까?아파치 모듈 컴파일 중 오류

[email protected]:~/apachemodule$ apxs2 -c -i -a example_module.c 
/usr/share/apr-1.0/build/libtool --silent --mode=compile --tag=disable-static x86_64-linux- gnu-gcc -prefer-pic -DLINUX=2 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D_REENTRANT -I/usr/include/apr-1.0 -I/usr/include/openssl -I/usr/include/xmltok -pthread  -I/usr/include/apache2 -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -c -o example_module.lo example_module.c && touch example_module.slo 
example_module.c:13:1: error: unknown type name 'module' 
example_module.c:15:5: error: 'STANDARD20_MODULE_STUFF' undeclared here (not in a function) 
example_module.c:16:5: warning: excess elements in scalar initializer [enabled by default] 
example_module.c:16:5: warning: (near initialization for 'example_module') [enabled by default] 
example_module.c:17:5: warning: excess elements in scalar initializer [enabled by default] 
example_module.c:17:5: warning: (near initialization for 'example_module') [enabled by default] 
example_module.c:18:5: warning: excess elements in scalar initializer [enabled by default] 
example_module.c:18:5: warning: (near initialization for 'example_module') [enabled by default] 
example_module.c:19:5: warning: excess elements in scalar initializer [enabled by default] 
example_module.c:19:5: warning: (near initialization for 'example_module') [enabled by default] 
example_module.c:20:5: warning: excess elements in scalar initializer [enabled by default] 
example_module.c:20:5: warning: (near initialization for 'example_module') [enabled by default] 
example_module.c:22:1: warning: excess elements in scalar initializer [enabled by default] 
example_module.c:22:1: warning: (near initialization for 'example_module') [enabled by default] 
apxs:Error: Command failed with rc=65536 

나는 아파치

답변

1

당신은 아마 헤더를 놓치고에서 예제 코드를 컴파일하려합니다. 가 여기에 최소한의 모듈의 그것을 컴파일하려고 : 당신이 아파치를 컴파일 한 경우

#include <httpd.h> 
#include <http_config.h> 

module example_module; 

static void example_hooks (apr_pool_t *pool) { 
} 

module example_module = { 
    STANDARD20_MODULE_STUFF, 
    NULL, 
    NULL, 
    NULL, 
    NULL, 
    NULL, 
    example_hooks 
}; 
0

, 당신의 APXS의 위치가 다를 수 있습니다. 시도해보십시오.

APXS=/usr/local/apache2/bin/apxs ./configure 
make 
make install 

추신 : DSO 모듈은 이미 활성화되어 있습니다. 을 통해 확인할 수 있습니다.

apache2ctl -m