0.10.2 on Ubuntu 19.10

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
zendril
Prole
Posts: 1
Joined: Sat Apr 11, 2020 4:05 pm

0.10.2 on Ubuntu 19.10

Post 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?
User avatar
pgimeno
Party member
Posts: 3549
Joined: Sun Oct 18, 2015 2:58 pm

Re: 0.10.2 on Ubuntu 19.10

Post 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).
Doyousketch2
Prole
Posts: 3
Joined: Wed May 03, 2017 9:35 pm

Re: 0.10.2 on Ubuntu 19.10

Post 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 .`
User avatar
pgimeno
Party member
Posts: 3549
Joined: Sun Oct 18, 2015 2:58 pm

Re: 0.10.2 on Ubuntu 19.10

Post 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.
User avatar
AuahDark
Party member
Posts: 107
Joined: Mon Oct 23, 2017 2:34 pm
Location: Indonesia
Contact:

Re: 0.10.2 on Ubuntu 19.10

Post 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.
Profile. Do you encounter crashes in LÖVE Android and wanna send me logcats? Please hit me up in LÖVE Discord and send the full logcat file!
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Semrush [Bot], Todespreis and 85 guests