compile issue in the mongoose example

74 views
Skip to first unread message

Jianyong Chen

unread,
Feb 19, 2014, 11:04:56 PM2/19/14
to mongoos...@googlegroups.com
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

Sergey Lyubka

unread,
Feb 20, 2014, 1:15:54 AM2/20/14
to mongoose-users
I think this is Lua compatibility.
Try lua 5.1.5 or lua 5.2.1


--
You received this message because you are subscribed to the Google Groups "mongoose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongoose-user...@googlegroups.com.
To post to this group, send email to mongoos...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongoose-users.
For more options, visit https://groups.google.com/groups/opt_out.

Jianyong Chen

unread,
Feb 20, 2014, 2:23:26 AM2/20/14
to mongoos...@googlegroups.com
Yes, it's Lua compatibility issue. With 5.1.5 and the following CFLAGS it works now.
# To enable Lua in a server, uncomment following lines
LUA    = ../lua-5.1.5/src
CFLAGS += -I$(LUA) -L$(LUA) -llua -lm -ldl -DMONGOOSE_USE_LUA

Thank you.

Jianyong
Reply all
Reply to author
Forward
0 new messages