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

linker issues: undefined symbol: lua_tointeger #56

Open
ensonic opened this issue Sep 28, 2016 · 1 comment
Open

linker issues: undefined symbol: lua_tointeger #56

ensonic opened this issue Sep 28, 2016 · 1 comment

Comments

@ensonic
Copy link

ensonic commented Sep 28, 2016

> mkdir build; cd build
> cmake ..
-- The C compiler identification is GNU 4.8.4
-- Check for working C compiler: /home/ensonic/bin/cc
-- Check for working C compiler: /home/ensonic/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Found Lua51: /usr/lib/x86_64-linux-gnu/liblua5.1.so;/usr/lib/x86_64-linux-gnu/libm.so (found version "5.1.5") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ensonic/projects/vitruvius/lua-cmsgpack/build
> make
Scanning dependencies of target cmsgpack
[100%] Building C object CMakeFiles/cmsgpack.dir/lua_cmsgpack.c.o
Linking C shared module cmsgpack.so
[100%] Built target cmsgpack
> lua ../test.lua 
lua: error loading module 'cmsgpack' from file './cmsgpack.so':
    ./cmsgpack.so: undefined symbol: lua_tointeger
stack traceback:
    [C]: in ?
    [C]: in function 'require'
    ../test.lua:5: in main chunk
    [C]: in ?
> ldd ./cmsgpack.so
    linux-vdso.so.1 =>  (0x00007ffeb3fe6000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fde16985000)
    /lib64/ld-linux-x86-64.so.2 (0x000055aa39fe4000)
> lua -v
Lua 5.2.3  Copyright (C) 1994-2013 Lua.org, PUC-Rio

Seems that the build is hardcoded to build against 5.1. Running under 5.1 works

lua5.1 ../test.lua 
@ensonic
Copy link
Author

ensonic commented Oct 4, 2016

The CMakeFile would ideally not use:

find_package(Lua51 REQUIRED)

but pkg-config (which has a lua5.1, lua.5.2, ...) dependning on what is installed. cmake-data does not have FindLua5.2 only 5.0 and 5.1 :/

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

1 participant