Page 1 of 1

0.10.2 on Ubuntu 19.10

Posted: Sat Apr 11, 2020 4:43 pm
by zendril
The edx.org GS50 course is using Love2D.

The issue is that they are requiring 0.10.2.

I can install 11.3 and start it just fine on Ubuntu 19.10, but I cannot seem to get the .deb files for 0.10.2 to install. They have missing dependencies.

Also, I've tried to build from src but hit this:

Code: Select all

In file included from libraries/luasocket/libluasocket/timeout.c:12:
libraries/luasocket/libluasocket/auxiliar.h:38:61: error: unknown type name ‘luaL_reg’; did you mean ‘luaL_Reg’?
   38 | void auxiliar_newclass(lua_State *L, const char *classname, luaL_reg *func);
      |                                                             ^~~~~~~~
      |                                                             luaL_Reg
Any thoughts?
Is this possibly needing a specific version of Lua to build with/against? If so, any ideas what version 0.10.2 required?

Re: 0.10.2 on Ubuntu 19.10

Posted: Sat Apr 11, 2020 5:57 pm
by pgimeno
I don't know why you get that error. I've compiled all versions starting with 0.1.1a; older ones needed a bit of editing (related to a library called DevIL which dropped a type definition) but we're talking until 0.4.something or so. Newer ones compiled without problems.

Anyway, you can use 11.3 instead of 0.10.2 for most purposes. The only major change, which is the colour range, is solved if you install this library:

https://love2d.org/forums/viewtopic.php?f=5&t=85137

and call require('cindy').applyPatch() at the top of your main.lua.

You may also be interested in polyamory (look in the signature of the OP of the topic I've linked).

Re: 0.10.2 on Ubuntu 19.10

Posted: Fri Jan 08, 2021 10:16 am
by Doyousketch2
It's just a typo, a lowercase r was used
'luaL_reg' where an uppercase should have 'luaL_Reg'.

Perhaps it compiles fine on another version of Linux,
or Windows, where capitalization doesn't matter.

Change to your love-0.10-2 directory, wherever that resides

Code: Select all

cd ~/Programming/Lua/Love2D/love-0.10.2/
Then run a sed (Stream Editor) command to fix all those
.c files and their .h headers where those unfortnate typos exist:

Code: Select all

sed -ie 's/luaL_reg/luaL_Reg/' ./src/libraries/luasocket/libluasocket/*.[ch]
Explaination:
  • `-i` in-place and use the `-e` expression
  • to `s/'` substitute all occurances of 'luaL_reg' with 'luaL_Reg'
  • in the subdirectory `/src/libraries/luasocket/libluasocket/`
  • where `*.[ch]` all .c and .h files are found
---
Alternatively, you could just open each of them in a text-editor then find-and-replace every instance of "luaL_reg" with "luaL_Reg" but that would take a while. That sed command is so much faster.
---

then `make` as usual.

I wouldn't `sudo make install` because you run the risk of
overwriting a newer version 11.3 or whatever you have installed systemwide.

instead, I would just copy or move the compiled version to somewhere in your path

Code: Select all

sudo cp ./src/love /usr/bin/love-10.2
then when you need to use that ver, just run it as usual
but specify which version `love-10.2 .`

Re: 0.10.2 on Ubuntu 19.10

Posted: Fri Jan 08, 2021 11:11 am
by pgimeno
Doyousketch2 wrote: Fri Jan 08, 2021 10:16 am Perhaps it compiles fine on another version of Linux,
or Windows, where capitalization doesn't matter.
For symbols I believe it always matters. Actually in my tree, a grep for luaL_reg shows this:

Code: Select all

src/libraries/luasocket/libluasocket/lua.h:#    define luaL_reg luaL_Reg
Not sure why your system is not reading that one.

Re: 0.10.2 on Ubuntu 19.10

Posted: Sat Jan 09, 2021 3:50 am
by AuahDark
LuaJIT 2.1 removes `luaL_reg`. LOVE 0.10.2 assumes LuaJIT 2.0 being used, so simple change to `luaL_reg` to `luaL_Reg` should fixes that problem.