Hi all,
I just try the mongoose yesterday and I feel it's a great project. I got one issue in compiling with lua.
1.I uncomment the lua line
# To enable Lua in a server, uncomment following lines
LUA = ../lua-5.2.3/src
CFLAGS += -I$(LUA) -L$(LUA) -llua
Compile is OK and I run server app, then I access
127.0.0.1:8080 with firefox. The page list all the files, when I click the file under lua. It returns 501 error.
2.I think the 501 error is that lua is not enabled. So I add -DMONGOOSE_USE_LUA in CFLAGS.
# To enable Lua in a server, uncomment following lines
LUA = ../lua-5.2.3/src
CFLAGS += -I$(LUA) -L$(LUA) -llua -DMONGOOSE_USE_LUA
The compile is not OK. It tell me:
cc hello.c ../mongoose.c -o hello -W -Wall -I.. -pthread -g -pipe -ldl -I../lua-5.2.3/src -L../lua-5.2.3/src -llua -DMONGOOSE_USE_LUA
../mongoose.c: In function ‘prepare_lua_environment’:
../mongoose.c:3349:3: warning: implicit declaration of function ‘luaL_register’ [-Wimplicit-function-declaration]
../mongoose.c: In function ‘handle_lsp_request’:
../mongoose.c:3445:22: error: ‘LUA_GLOBALSINDEX’ undeclared (first use in this function)
../mongoose.c:3445:22: note: each undeclared identifier is reported only once for each function it appears in
make: *** [all] Error 1
I search the ‘LUA_GLOBALSINDEX’ undeclared issue. Most tell me it's lua5.2 compatible problem.
Could somebody help me to resolve this?
Thank you.
Regards
Jianyong