cesanta / mongoose

Embedded Web Server
https://mongoose.ws
Other
11.15k stars 2.73k forks source link

Failing to build on Debian Testing #270

Closed HughPowell closed 10 years ago

HughPowell commented 10 years ago

This morning I've pulled down the latest mongoose source and updated my Debian Testing box. I've tried to build mongoose using the following command: $ make unix which fails with several warnings and errors, all of which are at pasted at the end of this issue.

The errors are all to do with the non-existance of off_t such as: lua_5.2.1.c:14485:20: error: unknown type name ‘off_t’

define l_seeknum off_t

I suspect this is due to not having a required package installed.

Any ideas?

Full output: cat src/internal.h src/util.c src/string.c src/parse_date.c src/options.c src/crypto.c src/auth.c src/win32.c src/unix.c src/mg_printf.c src/ssl.c src/http_client.c src/mime.c src/directory.c src/log.c src/parse_http.c src/io.c src/cgi.c src/upload.c src/websocket.c src/webdav.c src/mongoose.c src/lua.c | sed '/#include "internal.h"/d' > ../mongoose.c cc ../mongoose.c main.c -o mongoose -std=c99 -O2 -W -Wall -pedantic -pthread -pipe -I. -I.. -ldl -lm cc ../mongoose.c main.c lua_5.2.1.c -o mongoose-lua -DUSE_LUA -std=c99 -O2 -W -Wall -pedantic -pthread -pipe -I. -I.. -ldl -lm In file included from ../mongoose.c:455:0: ../mongoose.c: In function ‘prepare_lua_environment’: ./lua_5.2.1.h:1113:25: warning: value computed is not used [-Wunused-value](luaL_loadstring%28L, s%29 || lua_pcall%28L, 0, LUA_MULTRET, 0%29) ^ ../mongoose.c:5584:3: note: in expansion of macro ‘luaL_dostring’ luaL_dostring(L, "mg.onerror = function(e) mg.write('\nLua error:\n', " ^ ../mongoose.c: In function ‘lua_error_handler’: ./lua_5.2.1.h:1113:25: warning: value computed is not used [-Wunused-value](luaL_loadstring%28L, s%29 || lua_pcall%28L, 0, LUA_MULTRET, 0%29) ^
../mongoose.c:5597:5: note: in expansion of macro ‘luaL_dostring’
luaL_dostring(L, "mg.write(debug.traceback(), '\n')");
^
./lua_5.2.1.h:1113:25: warning: value computed is not used [-Wunused-value](luaL_loadstring%28L, s%29 || lua_pcall%28L, 0, LUA_MULTRET, 0%29)
^
../mongoose.c:5600:5: note: in expansion of macro ‘luaL_dostring’
luaL_dostring(L, "print(debug.traceback(), '\n')");
^
../mongoose.c: In function ‘mg_exec_lua_script’:
../mongoose.c:5620:29: warning: ISO C forbids conversion of object pointer to function pointer type [-Wpedantic]
lua_pushcclosure(L, (lua_CFunction) exports[i + 1], 0);
^
../mongoose.c: In function ‘lsp_sock_send’:
../mongoose.c:5380:19: warning: ‘n’ may be used uninitialized in this function [-Wmaybe-uninitialized]
lua_pushnumber(L, n);
^
lua_5.2.1.c: In function ‘luaD_throw’:
lua_5.2.1.c:5233:5: warning: implicit declaration of function ‘_longjmp’ [-Wimplicit-function-declaration]
LUAITHROW(L, L->errorJmp); /* jump to it /
^
lua_5.2.1.c: In function ‘io_pclose’:
lua_5.2.1.c:14639:3: warning: implicit declaration of function ‘pclose’ [-Wimplicit-function-declaration]
return luaL_execresult(L, lua_pclose(L, p->f));
^
lua_5.2.1.c: In function ‘io_popen’:
lua_5.2.1.c:14647:3: warning: implicit declaration of function ‘popen’ [-Wimplicit-function-declaration]
p->f = lua_popen(L, filename, mode);
^
lua_5.2.1.c:14647:8: warning: assignment makes pointer from integer without a cast [enabled by default]
p->f = lua_popen(L, filename, mode);
^
lua_5.2.1.c: In function ‘f_seek’:
lua_5.2.1.c:14485:20: error: unknown type name ‘off_t’

define l_seeknum off_t

                ^  

lua_5.2.1.c:14949:3: note: in expansion of macro ‘l_seeknum’
l_seeknum offset = (l_seeknum)p3;
^ lua_5.2.1.c:14485:20: error: ‘off_t’ undeclared (first use in this function)

define l_seeknum off_t

                ^

lua_5.2.1.c:14949:23: note: in expansion of macro ‘l_seeknum’ l_seeknum offset = (l_seeknum)p3; ^ lua_5.2.1.c:14485:20: note: each undeclared identifier is reported only once for each function it appears in

define l_seeknum off_t

                ^

lua_5.2.1.c:14949:23: note: in expansion of macro ‘l_seeknum’ l_seeknum offset = (l_seeknum)p3; ^ lua_5.2.1.c:14949:33: error: expected ‘,’ or ‘;’ before ‘p3’ l_seeknum offset = (l_seeknum)p3; ^ lua_5.2.1.c:14952:3: warning: implicit declaration of function ‘fseeko’ [-Wimplicit-function-declaration] op = l_fseek(f, offset, mode[op]); ^ lua_5.2.1.c:14956:5: warning: implicit declaration of function ‘ftello’ [-Wimplicit-function-declaration] lua_pushnumber(L, (lua_Number)l_ftell(f)); ^ lua_5.2.1.c: In function ‘os_tmpname’: lua_5.2.1.c:15448:3: warning: implicit declaration of function ‘mkstemp’ [-Wimplicit-function-declaration] lua_tmpnam(buff, err); ^ lua_5.2.1.c: In function ‘os_date’: lua_5.2.1.c:15540:5: warning: implicit declaration of function ‘gmtime_r’ [-Wimplicit-function-declaration] stm = l_gmtime(&t, &tmr); ^ lua_5.2.1.c:15540:9: warning: assignment makes pointer from integer without a cast [enabled by default] stm = l_gmtime(&t, &tmr); ^ lua_5.2.1.c:15544:5: warning: implicit declaration of function ‘localtime_r’ [-Wimplicit-function-declaration] stm = l_localtime(&t, &tmr); ^ lua_5.2.1.c:15544:9: warning: assignment makes pointer from integer without a cast [enabled by default] stm = llocaltime(&t, &tmr); ^ make: ** [mongoose-lua] Error 1

cpq commented 10 years ago

This is a duplicate of #269 Please see comments there.