LÖVE-Nuklear - a lightweight immediate mode GUI

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
CrimsonGuy
Prole
Posts: 48
Joined: Thu Apr 04, 2019 3:32 pm

Re: LÖVE-Nuklear - a lightweight immediate mode GUI

Post by CrimsonGuy »

Ok i got past that part, i was missing a command

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
Guess its related to the last error but i cant find how to tell make where are the lib files of lua

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
Hope those warnings dont cause problems, all this process was harder than it looked :death:

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'
User avatar
keharriso
Party member
Posts: 109
Joined: Fri Nov 16, 2012 9:34 pm

Re: LÖVE-Nuklear - a lightweight immediate mode GUI

Post by keharriso »

What happens if you follow the standard instructions with the following version?
Attachments
love-nuklear-v2.5.1.zip
(13.74 MiB) Downloaded 474 times
LÖVE-Nuklear - a lightweight immediate mode GUI for LÖVE games
User avatar
CrimsonGuy
Prole
Posts: 48
Joined: Thu Apr 04, 2019 3:32 pm

Re: LÖVE-Nuklear - a lightweight immediate mode GUI

Post by CrimsonGuy »

Thanks for the new build, will test it later and report back when i get home from work.
User avatar
CrimsonGuy
Prole
Posts: 48
Joined: Thu Apr 04, 2019 3:32 pm

Re: LÖVE-Nuklear - a lightweight immediate mode GUI

Post by CrimsonGuy »

^Same exact result sadly, did everything from step 1 and deleted last version nuklear.so to be sure maybe someone can pass me the .so file to see if its me or it doesnt work on linux in general, its probably me :o: .

Code: Select all

Error: attempt to index a nil value
stack traceback:
	[string "boot.lua"]:637: in function <[string "boot.lua"]:633>
	[C]: at 0x7fb670122cb0
	[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'
User avatar
keharriso
Party member
Posts: 109
Joined: Fri Nov 16, 2012 9:34 pm

Re: LÖVE-Nuklear - a lightweight immediate mode GUI

Post by keharriso »

Were you able to successfully build with only -DCMAKE_BUILD_TYPE=Release?

Try this example. If it works, try using your nuklear.so in place. If it doesn't work, I have a lot more debugging to do :death: .

EDIT: The way I'm testing this is with a VM of freshly installed Ubuntu 18.04.2.
Attachments
love-nuklear-example.zip
(159.36 KiB) Downloaded 380 times
LÖVE-Nuklear - a lightweight immediate mode GUI for LÖVE games
User avatar
CrimsonGuy
Prole
Posts: 48
Joined: Thu Apr 04, 2019 3:32 pm

Re: LÖVE-Nuklear - a lightweight immediate mode GUI

Post by CrimsonGuy »

It works!

Works well with your nuklear.so and crashes with my nuklear.so in both projects, now i wonder why.

I'm using Lua5.2 and latest Luajit and Cmake version and you can see were i'm aiming in this command

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

Well im happy i'll finally be able to put some GUI in my prototype, thanks for the help and sorry for the trouble. ;)
User avatar
keharriso
Party member
Posts: 109
Joined: Fri Nov 16, 2012 9:34 pm

Re: LÖVE-Nuklear - a lightweight immediate mode GUI

Post by keharriso »

Can you build successfully with just cmake -DCMAKE_BUILD_TYPE=Release ../love-nuklear if you install libluajit-5.1-dev?
LÖVE-Nuklear - a lightweight immediate mode GUI for LÖVE games
User avatar
CrimsonGuy
Prole
Posts: 48
Joined: Thu Apr 04, 2019 3:32 pm

Re: LÖVE-Nuklear - a lightweight immediate mode GUI

Post by CrimsonGuy »

Oh yea that was it !! Build the whole thing and tested the .so and it worked no warnings this time, so lua 5.2 is the most likely culprit.

Code: Select all

cmake -DCMAKE_BUILD_TYPE=Release ../love-nuklear 
-- The C compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found LuaJIT: /usr/lib/x86_64-linux-gnu/libluajit-5.1.so;/usr/lib/x86_64-linux-gnu/libm.so (found version "2.1.0-beta3") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/diego/Documents/love-nuklear-build
diego@Diego-PC:~/Documents/love-nuklear-build$ make
Scanning dependencies of target nuklear
[ 50%] Building C object CMakeFiles/nuklear.dir/src/nuklear_love.c.o
[100%] Linking C shared module nuklear.so
[100%] Built target nuklear
User avatar
keharriso
Party member
Posts: 109
Joined: Fri Nov 16, 2012 9:34 pm

Re: LÖVE-Nuklear - a lightweight immediate mode GUI

Post by keharriso »

Excellent! I'll update the build scripts and instructions, then officially release v2.5.1. Thanks for your help in debugging this.
LÖVE-Nuklear - a lightweight immediate mode GUI for LÖVE games
User avatar
CrimsonGuy
Prole
Posts: 48
Joined: Thu Apr 04, 2019 3:32 pm

Re: LÖVE-Nuklear - a lightweight immediate mode GUI

Post by CrimsonGuy »

Question that i cant seem to find via google. Does nuklear supports touchscreens (mobiles or tablets)? Just clicking the buttons or others widgets and such.
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests