# LUA 5.3 doesn't compile with haproxy 1.6.7

**URL:** <https://discourse.haproxy.org/t/lua-5-3-doesnt-compile-with-haproxy-1-6-7/521>\
**Category:** Help!\
**Created:** [July 25, 2016, 1:41am UTC](https://discourse.haproxy.org/t/lua-5-3-doesnt-compile-with-haproxy-1-6-7/521 "2016-07-25T01:41:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![azsfg](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/azsfg/32/102_2.png) [@azsfg](https://discourse.haproxy.org/u/azsfg)\
**Post date:** [July 25, 2016, 1:41am UTC](https://discourse.haproxy.org/t/lua-5-3-doesnt-compile-with-haproxy-1-6-7/521/1 "2016-07-25T01:41:33Z")

</div>

Hi All,

I’m on CentOs 5.11 x86\_64. I’m able to compile haproxy 1.6.7 (Without LUA). I’m able to compile Lua 5.3 (and install both). But when attempting to compile haproxy 1.6.7 w/ Lua, I get the following compile error:

```
make USE_PCRE=1 USE_OPENSSL=1 USE_LUA=1 USE_ZLIB=1 DEBUG="" ARCH=x86_64 TARGET=linux26 ADDLIB=-lz SPEC_CFLAGS="-Wdeclaration-after-statement" LUA_LIB_NAME=lua CC=gcc44
gcc44 -Iinclude -Iebtree -Wall -m64 -march=x86-64 -O2 -g -Wdeclaration-after-statement -DTPROXY -DCONFIG_HAP_CRYPT -DUSE_ZLIB -DENABLE_POLL -DENABLE_EPOLL -DNETFILTER -DUSE_GETSOCKNAME -DUSE_OPENSSL -DUSE_SYSCALL_FUTEX -DUSE_LUA -DUSE_PCRE -I/usr/include -DCONFIG_HAPROXY_VERSION=\"1.6.7\" -DCONFIG_HAPROXY_DATE=\"2016/07/13\" -c -o src/uri_auth.o src/uri_auth.c
In file included from /usr/include/lua.h:16,
                 from include/types/hlua.h:6,
                 from include/types/stream.h:36,
                 from include/proto/log.h:33,
                 from src/uri_auth.c:20:
/usr/include/luaconf.h:572:2: error: #error "Compiler does not support 'long long'. Use option '-DLUA_32BITS' or '-DLUA_C89_NUMBERS' (see file 'luaconf.h' for details)"
In file included from include/types/hlua.h:6,
                 from include/types/stream.h:36,
                 from include/proto/log.h:33,
                 from src/uri_auth.c:20:
/usr/include/lua.h:93: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘ __attribute__ ’ before ‘lua_Integer’
/usr/include/lua.h:96: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘ __attribute__ ’ before ‘lua_Unsigned’
/usr/include/lua.h:182: error: ‘lua_Integer’ declared as function returning a function
/usr/include/lua.h:226: error: expected declaration specifiers or ‘...’ before ‘lua_Integer’
/usr/include/lua.h:244: error: expected declaration specifiers or ‘...’ before ‘lua_Integer’
/usr/include/lua.h:246: error: expected declaration specifiers or ‘...’ before ‘lua_Integer’
/usr/include/lua.h:261: error: expected declaration specifiers or ‘...’ before ‘lua_Integer’
/usr/include/lua.h:263: error: expected declaration specifiers or ‘...’ before ‘lua_Integer’
In file included from include/types/hlua.h:7,
                 from include/types/stream.h:36,
                 from include/proto/log.h:33,
                 from src/uri_auth.c:20:
/usr/include/lauxlib.h:46: error: ‘lua_Integer’ declared as function returning a function
/usr/include/lauxlib.h:48: error: expected declaration specifiers or ‘...’ before ‘lua_Integer’
/usr/include/lauxlib.h:48: error: ‘lua_Integer’ declared as function returning a function
/usr/include/lauxlib.h:86: error: ‘lua_Integer’ declared as function returning a function
make: *** [src/uri_auth.o] Error 1

```

Any ideas what this could be? Googling wasn’t helpful for this case. Just FYI, I’m just testing with gcc44 above, the same exact issue happens with gcc (4.1).

If I do add -DLUA\_32BITS it **does** compile. But for some reason ld tries to link in 32bit shared libs.

```
/usr/bin/ld: skipping incompatible /usr/lib/libcrypt.so when searching for -lcrypt
/usr/bin/ld: skipping incompatible /usr/lib/libcrypt.a when searching for -lcrypt
/usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/libz.a when searching for -lz

```

Additionally, I really need 64bit numbers, not 32…

-Alex

---

<div class="post-metadata">

**Author:** ![azsfg](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/azsfg/32/102_2.png) [@azsfg](https://discourse.haproxy.org/u/azsfg)\
**Post date:** [July 28, 2016, 4:31am UTC](https://discourse.haproxy.org/t/lua-5-3-doesnt-compile-with-haproxy-1-6-7/521/2 "2016-07-28T04:31:40Z")

</div>

Replying to myself for future reference. These compile options worked for me:  
USE\_PCRE=1 USE\_OPENSSL=1 USE\_ZLIB=1 USE\_LUA=1 LUA\_LIB\_NAME=lua LDFLAGS=-ldl LUA\_LIB=/usr/lib64/ LUA\_INC=/usr/include/ ARCH=%{\_target\_cpu} TARGET=linux26 ADDLIB=-lz S  
PEC\_CFLAGS="-Wdeclaration-after-statement" DEFINE="-DLUA\_C89\_NUMBERS"

Specifically: **-DLUA\_C89\_NUMBERS**
