portl4t / ts-lua

Embed the Power of Lua into TrafficServer
72 stars 27 forks source link

use cjson got runtime error: undefined symbol: lua_getfield #9

Open portl4t opened 8 years ago

portl4t commented 8 years ago

local cjson = require "cjson"

Some user will use cjson in lua script, and got runtime error, e.g.

"...failed: error loading module 'cjson' from file ... undefined symbol: lua_getfield @ts_lua_util.c:152"

portl4t commented 8 years ago

This problem has serveral solutions:

Before we configure ats, we can execute the following command first: export LIBS=-llua-5.1 and after we build over, the binary traffic_server will require the liblua-5.1.so, and it works.

There is also another solution which is not recommended: Before we execute the traffic_server, we can execute the following command first: export LD_PRELOAD=/usr/lib64/liblua-5.1.so

I think the first solution is good.