FreeBSD build error
Closed this issue · 2 comments
devosalain commented
I have lua54 installed, ie
/usr/local/bin/lua54
/usr/local/bin/luac54
/usr/local/include/lua54/lauxlib.h
/usr/local/include/lua54/lua.h
/usr/local/include/lua54/lua.hpp
/usr/local/include/lua54/luaconf.h
/usr/local/include/lua54/lualib.h
/usr/local/lib/liblua-5.4.a
/usr/local/lib/liblua-5.4.so
gmake returns,
gmake[1]: Entering directory '/usr/home/x/test/moonfltk/src'
gmake[1]: lua: No such file or directory
c++ -O2 -Wall -Wextra -DCOMPAT53_PREFIX=moonfltk_compat_ -DLUAVER=5.3 -DUSE_GL=1 -DUSE_IMAGES=1 -DBEGIN_FLTK_INCLUDE='_Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wunused-parameter\"")' -DEND_FLTK_INCLUDE='_Pragma("GCC diagnostic pop")' -DLINUX -fpic -I/usr/include -I/usr/include/lua5.3 -I/usr/local/include -I/usr/local/include -D_THREAD_SAFE -pthread -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -O2 -pipe -fno-lto -O2 -pipe -march=ivybridge -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fno-lto -O2 -pipe -isystem /usr/local/include -fvisibility-inlines-hidden -I/usr/local/include -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT -c -o additional.o additional.cc
In file included from additional.cc:26:
In file included from ./internal.h:37:
./moonfltk.h:33:10: fatal error: 'lua.hpp' file not found
#include <lua.hpp>
^~~~~~~~~
1 error generated.
gmake[1]: *** [<builtin>: additional.o] Error 1
gmake[1]: Leaving directory '/usr/home/x/test/moonfltk/src'
gmake: *** [Makefile:5: build] Error 2
stetre commented
The problem is that the Makefile doesn't expect the installation directory of the header files to be named like that. It could be fixed in different ways, for example:
- by adding the option
-I/usr/local/include/lua54
to the INCDIR variable in src/Makefile (line 42), or - by using the CPLUS_INCLUDE_PATH environment variable to add the path, or
- by installing the headers in /usr/local/include or in /usr/local/include/lua5.4 (or creating soft links).
devosalain commented
Adding -I/usr/local/include/lua54 the Makefile & copying moonfltk.so to ./examples/fltk worked.