Hi everyone, I’ve just fixed the compilation for MOAI SDK in Linux.
In order to do this you’ll need to have some packages:
sudo apt-get install freeglut3 libxmu-dev libxi-dev cmake build-essential zlib1g-dev
Once you have those installed:
git clone git://github.com/moai/moai-dev.git
cd moai-dev/
git checkout linux
cd cmake/
cmake .
make
If everything goes OK you should have your binary on cmake/moai/moai
Hope it works for you!!!
Comment here if you have any problem.
UPDATE: There seems to be a problem with some Ubuntu installations regarding c-ares. I’ll try to identify what the problem is and get it working.
UPDATE 2: I’ve been able to reproduce the error. It seems that c-ares does not compile well in 32bit installations. I’ll see if I can get it working soon. Thanks Nicolas Oury and Jayant C Varma for reporting this!




I tired the steps you outlined but it did not work as expected.
https://www.dropbox.com/s/fnzjw65jq0nrm8i/gitCloneMoai.png
any suggestions on how to get this working?
Sorry about that, I updated the post, you need to run cmake . before make.
Hope this works for you now.
Awesome!
Time to create an AUR package
Awesome, it’s working fine
I’ve compiled moai succesfully on Arch Linux!
Anyway, I had a minor compilation problem with moai-test: after generating the files with CMake I had to change CMakeFiles/moai-test.dir/link.txt adding -ldl to link correctly the executable.
I would love to send a pull request with the fix, but I’m not expert enough with CMake.
I think I’m not exactly getting what moai-test is supposed to do. It looks like moai’s main executable (with added debugging capabilities) but it doesn’t depend on moai-core and its CMakeLists.txt is pretty different.
Had no problems linking moai though!
Thanks again for your work, did I mention it’s awesome being able to run moai on linux?
We’re in the process of redefining our testing framework, so don’t know what will be the fate of moai-test (which is basically moai plus MOAITestMgr linked on it).
So, I’ll let you all know when something happens here.
Thanks for this. I had to install freeglut-dev to get the cmake . to run.
Also needed libssl-dev, sqlite3, libsqlite3-dev, libexpat-dev, and libcurl4-openssl-dev.
This comment was a big help for me. Was getting frustrated figuring out why I couldn’t get Moai to build (a bunch of OpenGL errors).
Installing freeglut3-dev solved it.
I am getting this error when trying to compile on an Arch Linux system (i686):
[ 83%] Building C object luaext/CMakeFiles/luaext.dir/home/oli/dev/lib/moai-dev/3rdparty/luasql-2.2.0/src/luasql.c.o
/home/oli/dev/lib/moai-dev/3rdparty/luasql-2.2.0/src/ls_sqlite3.c: In function ‘opts_settimeout’:
/home/oli/dev/lib/moai-dev/3rdparty/luasql-2.2.0/src/ls_sqlite3.c:554:2: warning: passing argument 1 of ‘sqlite3_busy_timeout’ from incompatible pointer type [enabled by default]
In file included from /home/oli/dev/lib/moai-dev/3rdparty/luasql-2.2.0/src/ls_sqlite3.c:14:0:
/usr/include/sqlite3.h:2020:16: note: expected ‘struct sqlite3 *’ but argument is of type ‘struct conn_data *’
[ 83%] Building C object luaext/CMakeFiles/luaext.dir/home/oli/dev/lib/moai-dev/3rdparty/luafilesystem-1.5.0/src/lfs.c.o
[ 83%] Building C object luaext/CMakeFiles/luaext.dir/home/oli/dev/lib/moai-dev/3rdparty/luasocket-2.0.2/src/usocket.c.o
Linking C static library libluaext.a
[ 83%] Built target luaext
make: *** [all] Error 2
Any idea what this means? Thanks
No worries, I’ve just looked up a bit further and realized it’s the same c-ares/32-bit error