Page 1 of 1

Compiling on Ubuntu and Lua version

PostPosted: 20 Feb 2014, 10:40
by GunChleoc
I have trouble compiling on Ubuntu 12.4. I have installed the following Lua libraries in the software center:

liblua5.1-0
liblua5.1-0-dev
liblua5.2-0
liblua5.2-dev

CMake tells me "Incorrect Lua version, expected 5.2!"

So, I had to remove Lua 5.1, but I need it for a different project I'm working on. I have no idea if this can be improved upon, since this type of configuration is over my head.

I then ran make, and it complains about a missing lua.h. The stack is:

{l Code}: {l Select All Code}
Functions.h:27:0
GUIObject.h:24
Addons.h:25
Addons.cpp:20
ScriptExecutor.h:24:17

Re: Compiling on Ubuntu and Lua version

PostPosted: 20 Feb 2014, 11:36
by Edward_Lii
Hello GunChleoc,

GunChleoc {l Wrote}:CMake tells me "Incorrect Lua version, expected 5.2!"

We use CMake for finding the libraries we need and in case of Lua it sometimes finds the wrong version.
It is possible to manually adjust it using ccmake.
To do this, open up a terminal and in the directory where you would run cmake run:
{l Code}: {l Select All Code}
ccmake .

You should now see a few settings, hit 't' for advanced mode, search for the lines LUA_INCLUDE_DIR, LUA_LIBRARY, etc...
These values should point to Lua 5.2. I'm not sure where they are located on Ubuntu, but probably somewhere like /usr/lib64/liblua.so.5.2.

Once your done, hit 'c' and if there are no errors hit 'g'.
Now you should be able to build me and my shadow by running 'make'.

GunChleoc {l Wrote}:So, I had to remove Lua 5.1, but I need it for a different project I'm working on. I have no idea if this can be improved upon, since this type of configuration is over my head.

I then ran make, and it complains about a missing lua.h. The stack is:

Just to get this clear, you removed Lua 5.1, leaving only 5.2 installed and it failed to make?
Did you run cmake after you removed 5.1?

Re: Compiling on Ubuntu and Lua version

PostPosted: 20 Feb 2014, 14:55
by GunChleoc
Compiling was successful now, thanks! :)

Here's what I did for future reference:

Edward_Lii {l Wrote}:
GunChleoc {l Wrote}:CMake tells me "Incorrect Lua version, expected 5.2!"

We use CMake for finding the libraries we need and in case of Lua it sometimes finds the wrong version.
It is possible to manually adjust it using ccmake.
To do this, open up a terminal and in the directory where you would run cmake run:
{l Code}: {l Select All Code}
ccmake .

You should now see a few settings, hit 't' for advanced mode, search for the lines LUA_INCLUDE_DIR, LUA_LIBRARY, etc...
These values should point to Lua 5.2. I'm not sure where they are located on Ubuntu, but probably somewhere like /usr/lib64/liblua.so.5.2.

Once your done, hit 'c' and if there are no errors hit 'g'.
Now you should be able to build me and my shadow by running 'make'.

This has fixed it. The paths were still pointing to the deinstalled liblua5.1


Edward_Lii {l Wrote}:
GunChleoc {l Wrote}:So, I had to remove Lua 5.1, but I need it for a different project I'm working on. I have no idea if this can be improved upon, since this type of configuration is over my head.

I then ran make, and it complains about a missing lua.h. The stack is:

Just to get this clear, you removed Lua 5.1, leaving only 5.2 installed and it failed to make?
Did you run cmake after you removed 5.1?

For the record: yes and yes.