Installing lcomplex on Lua 5.3

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Installing lcomplex on Lua 5.3

Aditya Mahajan
Hi,

I am trying to install lcomplex on Lua 5.3 using

   $luarocks install lcomplex --local

which gives

Installing https://luarocks.org/lcomplex-20120430-1.src.rock

gcc -O2 -fPIC -I/usr/include -c lcomplex.c -o lcomplex.o
lcomplex.c: In function ‘luaopen_complex’:
lcomplex.c:155:2: warning: implicit declaration of function
‘luaL_register’; did you mean ‘lua_register’?
[-Wimplicit-function-declaration]
   luaL_register(L,MYNAME,R);
   ^~~~~~~~~~~~~
   lua_register
gcc -shared -o complex.so lcomplex.o
lcomplex 20120430-1 is now installed in /home/adityam/.luarocks (license:
MIT/X11)

The library gets installed but when I try to use it, I get the error

   $lua -lcomplex

which gives (as expected)

lua: error loading module 'complex' from file
'/home/adityam/.luarocks/lib/lua/5.3/complex.so':
         /home/adityam/.luarocks/lib/lua/5.3/complex.so: undefined symbol:
luaL_register
stack traceback:
         [C]: in ?
         [C]: in function 'require'
         [C]: in ?


Any hints on how to fix this?

Thanks,
Aditya
Reply | Threaded
Open this post in threaded view
|

Re: Installing lcomplex on Lua 5.3

Thijs Schreijer


On 6 Apr 2019, at 17:50, Aditya Mahajan <[hidden email]> wrote:

Hi,

I am trying to install lcomplex on Lua 5.3 using

 $luarocks install lcomplex --local

which gives

Installing https://luarocks.org/lcomplex-20120430-1.src.rock

gcc -O2 -fPIC -I/usr/include -c lcomplex.c -o lcomplex.o
lcomplex.c: In function ‘luaopen_complex’:
lcomplex.c:155:2: warning: implicit declaration of function ‘luaL_register’; did you mean ‘lua_register’? [-Wimplicit-function-declaration]
 luaL_register(L,MYNAME,R);
 ^~~~~~~~~~~~~
 lua_register
gcc -shared -o complex.so lcomplex.o
lcomplex 20120430-1 is now installed in /home/adityam/.luarocks (license: MIT/X11)


Since it was marked as deprecated in 5.2, it was probably deleted from 5.3.

It might be that the source was updated, but no new LuaRock was published. So you could try to download the source

Then either build that, or take the existing .rockspec file and copy it into the source directory. Then from the source directory do `luarocks make`. Might just work.

Hth
Thijs