cmake -DLUA_INCLUDE_DIR=/usr/lib/x86_64-linux-gnu/ -DLUA_LIBRARY=/usr/lib/x86_64-linux-gnu/liblua5.2.so -DCMAKE_BUILD_TYPE=Release ../love-nuklear
now im stuck when doing the make command
Code: Select all
fatal error: lua.h: No such file or directory
#include <lua.h>
^~~~~~~
compilation terminated.
CMakeFiles/nuklear.dir/build.make:62: recipe for target 'CMakeFiles/nuklear.dir/src/nuklear_love.c.o' failed
make[2]: *** [CMakeFiles/nuklear.dir/src/nuklear_love.c.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/nuklear.dir/all' failed
make[1]: *** [CMakeFiles/nuklear.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
EDIT
Ok finally managed to build the nuklear.so but with some warnings had to remake the make file with this new filepaths, seems like the others were wrong
cmake -DLUA_INCLUDE_DIR=/usr/include/lua5.2/ -DLUA_LIBRARY=/usr/lib/x86_64-linux-gnu/liblua5.2.so -DCMAKE_BUILD_TYPE=Release ../love-nuklear
Code: Select all
Scanning dependencies of target nuklear
[ 50%] Building C object CMakeFiles/nuklear.dir/src/nuklear_love.c.o
/home/diego/Documents/love-nuklear/src/nuklear_love.c: In function ‘nk_love_checkcontext’:
/home/diego/Documents/love-nuklear/src/nuklear_love.c:98:20: warning: implicit declaration of function ‘lua_equal’; did you mean ‘lua_rawequal’? [-Wimplicit-function-declaration]
int is_context = lua_equal(L, -1, -2);
^~~~~~~~~
lua_rawequal
/home/diego/Documents/love-nuklear/src/nuklear_love.c:103:2: warning: implicit declaration of function ‘luaL_typerror’; did you mean ‘luaL_error’? [-Wimplicit-function-declaration]
luaL_typerror(L, index, "Nuklear context");
^~~~~~~~~~~~~
luaL_error
/home/diego/Documents/love-nuklear/src/nuklear_love.c: In function ‘nk_love_parse_window_flags’:
/home/diego/Documents/love-nuklear/src/nuklear_love.c:297:22: warning: implicit declaration of function ‘lua_objlen’; did you mean ‘lua_len’? [-Wimplicit-function-declaration]
size_t flagCount = lua_objlen(L, flags_begin);
^~~~~~~~~~
lua_len
[100%] Linking C shared module nuklear.so
[100%] Built target nuklear
EDIT2
I get this error when using local nuklear = require 'nuklear' in my love.load() with nuklear.so next to my main.lua
Code: Select all
Error: attempt to index a nil value
stack traceback:
[string "boot.lua"]:637: in function <[string "boot.lua"]:633>
[C]: at 0x7fb41828bcb0
[C]: in function 'require'
main.lua:6: in function 'load'
[string "boot.lua"]:488: in function <[string "boot.lua"]:487>
[C]: in function 'xpcall'
[string "boot.lua"]:650: in function <[string "boot.lua"]:639>
[C]: in function 'xpcall'