Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting couple of undefined_reference errors #24

Open
ikouchiha47 opened this issue Sep 17, 2019 · 1 comment
Open

Getting couple of undefined_reference errors #24

ikouchiha47 opened this issue Sep 17, 2019 · 1 comment

Comments

@ikouchiha47
Copy link

./luastatic.lua lpm.lua src/reader.lua src/parser.lua -I/usr/include/lua5.3/

cc -Os lpm.lua.c -rdynamic -lm -o lpm -I/usr/include/lua5.3/
/usr/bin/ld: /tmp/ccvKVuNz.o: in function lstop': lpm.lua.c:(.text+0x32): undefined reference to lua_sethook'
/usr/bin/ld: /tmp/ccvKVuNz.o: in function msghandler': lpm.lua.c:(.text+0x56): undefined reference to lua_tolstring'
/usr/bin/ld: lpm.lua.c:(.text+0x6f): undefined reference to luaL_callmeta' /usr/bin/ld: lpm.lua.c:(.text+0x80): undefined reference to lua_type'
/usr/bin/ld: lpm.lua.c:(.text+0x8a): undefined reference to lua_typename' /usr/bin/ld: lpm.lua.c:(.text+0x9e): undefined reference to lua_pushfstring'
/usr/bin/ld: lpm.lua.c:(.text+0xab): undefined reference to lua_type' /usr/bin/ld: lpm.lua.c:(.text+0xc7): undefined reference to lua_getglobal'
/usr/bin/ld: lpm.lua.c:(.text+0xd9): undefined reference to lua_getfield' /usr/bin/ld: lpm.lua.c:(.text+0xe9): undefined reference to lua_rotate'
/usr/bin/ld: lpm.lua.c:(.text+0xf6): undefined reference to lua_settop' /usr/bin/ld: lpm.lua.c:(.text+0x101): undefined reference to lua_pushstring'
/usr/bin/ld: lpm.lua.c:(.text+0x111): undefined reference to lua_rotate' /usr/bin/ld: lpm.lua.c:(.text+0x11e): undefined reference to lua_settop'
/usr/bin/ld: lpm.lua.c:(.text+0x12b): undefined reference to lua_pushinteger' /usr/bin/ld: lpm.lua.c:(.text+0x142): undefined reference to lua_callk'

Any idea how to solve this?

@ers35
Copy link
Owner

ers35 commented Sep 18, 2019

You need to link with the Lua library. For example, try adding -l/usr/lib/x86_64-linux-gnu/liblua5.3.a to the command line.

Run this command to search for liblua.a on your system: find /usr/lib -name liblua*

See: https://github.com/ers35/luastatic#examples

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants