Search code examples
nginxjson-c

nginx module with json-c undefined symbol: json_object_to_json_string


for install nginx with hello module(this module use #include )

i use yum -y install json-c json-c-devel before install nginx

make && make install is successful. but when i run nginx test

/usr/sbin/nginx -t

error message is show up :

nginx: [emerg] dlopen() "/etc/nginx/modules/ngx_http_hello_module.so" failed (/etc/nginx/modules/ngx_http_hello_module.so: undefined symbol: json_object_to_json_string) in /etc/nginx/nginx.conf:5
nginx: configuration file /etc/nginx/nginx.conf test failed

ldd /usr/sbin/nginx

json-c library is not loadded! what can i do?


Solution

  • solve this problem ;)

    method is : ./configure ... --with-ld-opt="-ljson"

    after success install(make && make install), type ldd /usr/sbin/ngin then you will show loaded library file(.so)