trouble with the lua module

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

OffbeatPatriot
Just popping in
Just popping in
Posts: 8
Joined: Tue Jul 29, 2008 05:16

trouble with the lua module

Postby OffbeatPatriot » Fri Feb 06, 2009 10:33

I have CEGUI working perfectly on my home computer but now I want to have it on the lap top I'm using right now. Unfortunately I'm pretty sure I've done everything I've done before but I get these errors when I try to compile my project.

/usr/local/lib/libCEGUILuaScriptModule.so: undefined reference to `luaopen_table'
/usr/local/lib/libCEGUItoluapp.so.1: undefined reference to `lua_dobuffer'
/usr/local/lib/libCEGUILuaScriptModule.so: undefined reference to `luaopen_io'
/usr/local/lib/libCEGUILuaScriptModule.so: undefined reference to `luaL_unref'
/usr/local/lib/libCEGUILuaScriptModule.so: undefined reference to `luaL_error'
/usr/local/lib/libCEGUILuaScriptModule.so: undefined reference to `luaopen_string'
/usr/local/lib/libCEGUILuaScriptModule.so: undefined reference to `luaopen_base'
/usr/local/lib/libCEGUItoluapp.so.1: undefined reference to `luaL_getmetatable'
/usr/local/lib/libCEGUItoluapp.so.1: undefined reference to `luaL_newmetatable'
/usr/local/lib/libCEGUILuaScriptModule.so: undefined reference to `luaL_loadbuffer'
/usr/local/lib/libCEGUILuaScriptModule.so: undefined reference to `luaopen_math'
/usr/local/lib/libCEGUILuaScriptModule.so: undefined reference to `luaL_ref'

I got the same errors when trying to compile CEGUI until I disabled the samples. I'm using ubuntu and I've gotten lua out of the repositries, being quite confused I've downloaded lua 5.0, 4.0, 5.1, and toLua(maybe, the name was a little funny).

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Fri Feb 06, 2009 12:27

Hi,

The error is a lua linking error, so it seems the liblua or whatever is not being picked up correctly for some reason. Btw, either lua 5.0 or 5.1 should work, lua 4.x definitely will not work.

Do you run the same distro on your home computer and laptop?

And, finally, can you post the config.log please.

If you don't need the lua support and would rather just disable it, add the --disable-lua-module option and you should get past that error, and also get the majority of the samples (those that do not use lua).

Thanks,

CE.

OffbeatPatriot
Just popping in
Just popping in
Posts: 8
Joined: Tue Jul 29, 2008 05:16

Postby OffbeatPatriot » Sat Feb 07, 2009 04:22

I definitely need lua, also, the desktop that CEGUI works on is Ubuntu 8.04 and the laptop is Xubuntu 8.04, not exactly the same but I thought the difference was unimportant.

I left the laptop at work so I'll get the config file tomorrow, but I thought I'd mention I put -llua5.1 in my Makefile and I still have errors but less then half I had before, I don't remember which ones, I'll check tomorrow, but they seemed to refer to tolua, which I think I have installed and thought of adding the flag for that in my makefile too but I didn't know what it would be.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Sat Feb 07, 2009 09:44

Hi,

I think I misunderstood the original point; I thought the main issue was with building CEGUI, as opposed to your own app (in that case I do not think the config.log is important).

This is similar to a query from the other day (also involving a differences between building on Ubuntu and another distro - not sure if that's a clue there that I need to look into ;)).

Anyway, you'll need to also add our tolua++ lib, so the flag to add should be:

Code: Select all

-lCEGUItoluapp


HTH

CE.

nash911
Just popping in
Just popping in
Posts: 3
Joined: Mon Mar 22, 2010 21:04

Re: trouble with the lua module

Postby nash911 » Mon Mar 22, 2010 21:15

Dear CE,

I have exactly the same error while trying to build CEGUI for installing,

Code: Select all

bs/libCEGUItoluapp.so -llua50 -lglut -lGLU -lGL -lSM -lICE
../../../ScriptingModules/CEGUILua/LuaScriptModule/src/.libs/libCEGUILuaScriptModule.so: undefined reference to `luaopen_table'
/home/avinash/src_2.4.0/CEGUI-0.6.2/ScriptingModules/CEGUILua/tolua++/.libs/libCEGUItoluapp.so: undefined reference to `lua_dobuffer'
../../../ScriptingModules/CEGUILua/LuaScriptModule/src/.libs/libCEGUILuaScriptModule.so: undefined reference to `luaopen_io'
../../../ScriptingModules/CEGUILua/LuaScriptModule/src/.libs/libCEGUILuaScriptModule.so: undefined reference to `luaL_unref'
../../../ScriptingModules/CEGUILua/LuaScriptModule/src/.libs/libCEGUILuaScriptModule.so: undefined reference to `luaL_error'
../../../ScriptingModules/CEGUILua/LuaScriptModule/src/.libs/libCEGUILuaScriptModule.so: undefined reference to `luaopen_string'
../../../ScriptingModules/CEGUILua/LuaScriptModule/src/.libs/libCEGUILuaScriptModule.so: undefined reference to `luaopen_base'
/home/avinash/src_2.4.0/CEGUI-0.6.2/ScriptingModules/CEGUILua/tolua++/.libs/libCEGUItoluapp.so: undefined reference to `luaL_getmetatable'
/home/avinash/src_2.4.0/CEGUI-0.6.2/ScriptingModules/CEGUILua/tolua++/.libs/libCEGUItoluapp.so: undefined reference to `luaL_newmetatable'
../../../ScriptingModules/CEGUILua/LuaScriptModule/src/.libs/libCEGUILuaScriptModule.so: undefined reference to `luaL_loadbuffer'
../../../ScriptingModules/CEGUILua/LuaScriptModule/src/.libs/libCEGUILuaScriptModule.so: undefined reference to `luaopen_math'
../../../ScriptingModules/CEGUILua/LuaScriptModule/src/.libs/libCEGUILuaScriptModule.so: undefined reference to `luaL_ref'
collect2: ld returned 1 exit status
make[3]: *** [Demo8] Error 1
make[3]: Leaving directory `/home/avinash/src_2.4.0/CEGUI-0.6.2/Samples/Demo8/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/avinash/src_2.4.0/CEGUI-0.6.2/Samples/Demo8'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/avinash/src_2.4.0/CEGUI-0.6.2/Samples'
make: *** [all-recursive] Error 1


I am on a Ubuntu 9.04 operating system, with a AMD x64 duel core machine. I have lua version 5.0.3-3 installed.

I need CEGUI as a third party requirement for Delta 3D simulation engine. So I am guessing I do need lua support.

I am a newbie to Linux, and so I am unable to understand where I need to add the flag '-lCEGUItoluapp' to, that you have mentioned in the above post. Please explain in more detail for a newbie.

Thanks in advance,
nash911

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: trouble with the lua module

Postby CrazyEddie » Tue Mar 23, 2010 11:47

Hi,

Since this is when trying to build CEGUI, you'll need to post your config.log file so I can see what went on during the configure step. The reference to -lCEGUItoluapp is only when building something that uses CEGUI - i.e. after CEGUI is successfully built and installed.

CE.

nash911
Just popping in
Just popping in
Posts: 3
Joined: Mon Mar 22, 2010 21:04

Re: trouble with the lua module

Postby nash911 » Tue Mar 23, 2010 21:30

Dear CE,

Please find the attached config.log file. I had heard/read somewhere that LUA support is not required for Delta 3D, and so disabled it while configuring, using the command you have mentioned above in one of your earlier posts.

Thanks,
nash911

p.s: I couldn't find an option to upload the log file, so I am pasting the log entries here below,

Code: Select all

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for g++... g++
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking dependency style of g++... (cached) gcc3
checking how to run the C++ preprocessor... g++ -E
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for dlopen in -ldl... yes
checking for pthread_create in -lpthread... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for freetype2... yes
checking for pcre... yes
checking for libxml... no
checking for main in -lxerces-c... yes
checking for XML_ParserCreate in -lexpat... yes
checking for main in -ltinyxml... no
configure: Default XML Parser will be: XercesParser
checking for ANSI C header files... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for size_t... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for working volatile... yes
checking for ptrdiff_t... yes
checking for error_at_line... yes
checking for working memcmp... yes
checking whether time.h and sys/time.h may both be included... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for alarm... yes
checking for working mktime... yes
checking for working strcoll... yes
checking for strftime... yes
checking for atexit... yes
checking for floor... yes
checking for memchr... yes
checking for memmove... yes
checking for memset... yes
checking for pow... yes
checking for regcomp... yes
checking for setlocale... yes
checking for sqrt... yes
checking for strchr... yes
checking for strcspn... yes
checking for strerror... yes
checking for strpbrk... yes
checking for strtoul... yes
checking for X... libraries , headers
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
checking for library containing glInterleavedArrays... -lGL
checking for library containing gluOrtho2D... -lGLU
checking for library containing glutInit... -lglut
checking for glewInit in -lGLEW... no
configure: OpenGL renderer enabled
checking for ilLoadL in -lIL... yes
checking for iluFlipImage in -lILU... yes
configure: Image loading via DevIL by OpenGL renderer enabled
checking for library containing FreeImage_GetVersion... no
checking FreeImage.h usability... no
checking FreeImage.h presence... no
checking for FreeImage.h... no
configure: Image loading via FreeImage by OpenGL renderer disabled
checking for SILLY... no
configure: Image loading via SILLY by OpenGL renderer disabled
checking for corona-config... no
checking for corona - version >= 1.2.0... no
configure: Use of OpenGL in Samples is enabled
configure: Default ImageCodec will be: DevILImageCodec
checking for CEGUIOGRE... no
checking for CEGUI_NULL... no
checking for OIS... no
configure:
****************************************************************
* You do not have OIS installed.  This is required to build    *
* Ogre CEGUI demos. You may find it at:                        *
* http://www.sourceforge.net/projects/wgois.                   *
* If you do not want to build the demos, you can safely ignore *
* this.                                                        *
****************************************************************
configure: Use of Ogre3D in Samples is disabled
checking for main in -lIrrlicht... no
checking for XF86VidModeQueryVersion in -lXxf86vm... yes
configure: Irrlicht renderer disabled
checking for directfb... yes
configure: Use of DirectFB in Samples is enabled
checking for GTK... yes
configure: GTK2 renderer selection dialog in samples is disabled
configure: Samples framework and applications are enabled.
checking for Lua... no
checking for Lua... no
checking for Lua... no
checking for Lua... yes
configure: Building of Lua scripting module is disabled
configure: Building of tolua++cegui generator tool is disabled.
configure: creating ./config.status
config.status: creating Makefile
config.status: creating ImageCodecModules/Makefile
config.status: creating ImageCodecModules/CoronaImageCodec/Makefile
config.status: creating ImageCodecModules/DevILImageCodec/Makefile
config.status: creating ImageCodecModules/FreeImageImageCodec/Makefile
config.status: creating ImageCodecModules/SILLYImageCodec/Makefile
config.status: creating ImageCodecModules/TGAImageCodec/Makefile
config.status: creating RendererModules/directx81GUIRenderer/Makefile
config.status: creating RendererModules/directx9GUIRenderer/Makefile
config.status: creating RendererModules/directx10GUIRenderer/Makefile
config.status: creating RendererModules/directfbRenderer/Makefile
config.status: creating RendererModules/IrrlichtRenderer/Makefile
config.status: creating RendererModules/Makefile
config.status: creating RendererModules/OpenGLGUIRenderer/Makefile
config.status: creating Samples/Demo6/Makefile
config.status: creating Samples/Demo6/src/Makefile
config.status: creating Samples/Demo7/Makefile
config.status: creating Samples/Demo7/src/Makefile
config.status: creating Samples/Demo8/Makefile
config.status: creating Samples/Demo8/src/Makefile
config.status: creating Samples/DragDropDemo/Makefile
config.status: creating Samples/FalagardDemo1/Makefile
config.status: creating Samples/FalagardDemo1/include/Makefile
config.status: creating Samples/FalagardDemo1/src/Makefile
config.status: creating Samples/FirstWindow/Makefile
config.status: creating Samples/FirstWindow/include/Makefile
config.status: creating Samples/FirstWindow/src/Makefile
config.status: creating Samples/FontDemo/Makefile
config.status: creating Samples/FontDemo/src/Makefile
config.status: creating Samples/InstancedWindows/Makefile
config.status: creating Samples/InstancedWindows/include/Makefile
config.status: creating Samples/InstancedWindows/src/Makefile
config.status: creating Samples/Minesweeper/Makefile
config.status: creating Samples/Minesweeper/src/Makefile
config.status: creating Samples/ScrollablePaneDemo/Makefile
config.status: creating Samples/ScrollablePaneDemo/src/Makefile
config.status: creating Samples/TabControlDemo/Makefile
config.status: creating Samples/TabControlDemo/src/Makefile
config.status: creating Samples/TextDemo/Makefile
config.status: creating Samples/TextDemo/src/Makefile
config.status: creating Samples/TreeDemo/Makefile
config.status: creating Samples/TreeDemo/include/Makefile
config.status: creating Samples/TreeDemo/src/Makefile
config.status: creating Samples/Makefile
config.status: creating Samples/common/Makefile
config.status: creating Samples/common/include/Makefile
config.status: creating Samples/common/src/Makefile
config.status: creating Samples/datafiles/Makefile
config.status: creating ScriptingModules/CEGUILua/LuaScriptModule/Makefile
config.status: creating ScriptingModules/CEGUILua/LuaScriptModule/include/Makefile
config.status: creating ScriptingModules/CEGUILua/LuaScriptModule/package/Makefile
config.status: creating ScriptingModules/CEGUILua/LuaScriptModule/src/Makefile
config.status: creating ScriptingModules/CEGUILua/Makefile
config.status: creating ScriptingModules/CEGUILua/tolua++/Makefile
config.status: creating ScriptingModules/CEGUILua/tolua++bin/Makefile
config.status: creating ScriptingModules/Makefile
config.status: creating WindowRendererSets/Makefile
config.status: creating WindowRendererSets/Falagard/Makefile
config.status: creating WindowRendererSets/Falagard/include/Makefile
config.status: creating WindowRendererSets/Falagard/src/Makefile
config.status: creating XMLParserModules/Makefile
config.status: creating XMLParserModules/TinyXMLParser/Makefile
config.status: creating XMLParserModules/XercesParser/Makefile
config.status: creating XMLParserModules/expatParser/Makefile
config.status: creating XMLParserModules/libxmlParser/Makefile
config.status: creating include/Makefile
config.status: creating include/elements/Makefile
config.status: creating include/falagard/Makefile
config.status: creating makefiles/Makefile
config.status: creating src/Makefile
config.status: creating CEGUI.pc
config.status: creating CEGUI-OPENGL.pc
config.status: creating CEGUI.spec
config.status: creating include/config.h
config.status: executing depfiles commands
config.status: executing libtool commands

********************************************************************************
* Crazy Eddie's GUI System - Configuration Results Summary
********************************************************************************
* Library Release Version:                              0.6.2
*
* Code options:
*         Building CEGUI in debug mode:                 no
*
* Renderer Modules:
*         Building OpenGL Renderer:                     yes
*             Using external GLEW library:              no
*         Building Irrlicht Renderer:                   no
*         Building DirectFB Renderer:                   yes
*
* Image Loading Codec Modules (currently for OpenGL Renderer only):
*         Building Corona Image Codec:                  no
*         Building DevIL Image Codec:                   yes
*         Building FreeImage Image Codec:               no
*         Building SILLY Image Codec:                   no
*         Building TGA Image Codec:                     yes
*
*         Default Image Codec will be:                  DevILImageCodec
*
* XML Parser Modules:
*         Building TinyXMLParser:                       yes
*             Using external TinyXML library:           no
*         Building ExpatParser:                         yes
*         Building LibXMLParser:                        no
*         Building XercesParser:                        yes
*
*         Default XML Parser is:                        XercesParser
*
* Scripting:
*         Building Lua scripting module:                no
*         Building tolua++cegui generator:              no
*
* Samples Framework:
*         Building Samples:                             yes
*         GTK2 based dialog for renderer selection:     no
*         OpenGL Renderer available in samples:         yes
*         Irrlicht Renderer available in samples:       no
*         DirectFB Renderer available in samples:       yes
*         Ogre3D Renderer available in samples:         no
********************************************************************************

Now you can do make && make install.  Good Luck!

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: trouble with the lua module

Postby CrazyEddie » Wed Mar 24, 2010 10:26

I"m glad you got past the 'block' by disabling the Lua module. I think I will have to try and dig a bit deeper to see why this part of the build fails for some people, the configure summary you posted shows Lua is detected correctly, which probably means I have messed up the build system somewhere along the line and it only manifests itself under certain conditions ;)

CE.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: trouble with the lua module

Postby CrazyEddie » Thu Mar 25, 2010 14:36

I have tested this and have found the issue to be that under Ubuntu the lua 5.0 packages are separate for the core lua and lualib, because we only check for lua and not lualib the second lib is not being linked in. So, the solution is to ensure you have liblualib50-dev installed (which you do, otherwise you would get a missing header error), and then specify the missing lib at compile time, perhaps like this:

Code: Select all

$ make LDFLAGS="-llualib50"

The compilation will then succeed and the lua stuff work ok :)

The newer releases of CEGUI require lua 5.1 and are not affected by this issue, as such there are no plans to fix this in the older branch.

CE.

nash911
Just popping in
Just popping in
Posts: 3
Joined: Mon Mar 22, 2010 21:04

Re: trouble with the lua module

Postby nash911 » Thu Mar 25, 2010 19:00

Dear CE,

Thanks for the reply, and the solution.

-nash911


Return to “Help”

Who is online

Users browsing this forum: No registered users and 3 guests