Month: August 2018

the moon… beautiful! oh yeah!

Today I decided to test the Lua (the programming language, it means Moon in Portuguese) with FLTK. There is a project called lua-fltk4lua.

Unfortunately the project doesn’t explain how to compile it from source code and it expects the developer uses the “luarocks” package manager to install it.

Although initially I was getting some issues like:

No rule to make target “moon/moon.h”
No rule to make target “compat-5.3/c-api/compat-5.3.h”

I figured out how to get it compiled and working easily, find the steps below:

$ sudo apt-get install lua5.2

$ sudo apt-get install liblua5.2-dev

$ sudo apt-get install libfltk1.3-dev

$ git clone

$ cd lua-fltk4lua

$ git clone moon

$ git clone compat-5.3

$ make

$ sudo make install

This is a nice Hello World to see it working, just create a hello.lua file with it:

local fl = require( "fltk4lua" )
local window = fl.Window( 340, 180, "Hello" )
local box = fl.Box( 20, 40, 300, 100, "Hello World!" ) = "FL_UP_BOX"
box.labelfont = "FL_HELVETICA_BOLD_ITALIC"
box.labelsize = 36
box.labeltype = "FL_SHADOW_LABEL"
window:show( arg )

And run:

$ lua hello.lua

Just it!