Recent

Author Topic: cannot link lua52  (Read 3494 times)

Severak

  • Newbie
  • Posts: 3
cannot link lua52
« on: October 08, 2016, 09:59:06 pm »
Hi,
I got new Raspberry Pi3 and wanted to compile my old program using Lazarus.

I got this error from linker:

/usr/bin/ld.bfd: warning: link.res contains output sections; did you forget -T?
/usr/bin/ld.bfd: cannot find -llua52
svlad.lpr(22) Error: Error while linking
svlad.lpr(22) Fatal: There were 1 errors compiling module, stopping
ERROR: failed compiling of project /home/pi/Desktop/severak/svlad2/svlad.lpi


Note that I use lua52.pas file, which is located in same folder as other program files. This file is just a wrapper of lua5.2 DLL/SO lib, which seems to be installed in system.

On Windows, compilation just works.

Look at my source code here, if you need it: https://github.com/severak/svlad2

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8731
  • FPC developer.
Re: cannot link lua52
« Reply #1 on: October 08, 2016, 10:00:28 pm »
Do you have a file called liblua52.so  ?

Severak

  • Newbie
  • Posts: 3
Re: cannot link lua52
« Reply #2 on: October 09, 2016, 11:24:16 pm »
> Do you have a file called liblua52.so  ?

It seems there is a symlink to it from /usr/lib/arm-linux-gnueabihf.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8266
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: cannot link lua52
« Reply #3 on: October 10, 2016, 09:28:16 am »
> Do you have a file called liblua52.so  ?

It seems there is a symlink to it from /usr/lib/arm-linux-gnueabihf.
Does that directory exist in linker search path?

Thaddy

  • Hero Member
  • *****
  • Posts: 10482
Re: cannot link lua52
« Reply #4 on: October 10, 2016, 11:30:44 am »
Raspbian jessie has lua50 and lua51, not lua52. You will explicitly have to install it.
sudo apt-get lua5.2 lua5.2-dev
Note the dot.
After that you have the proper libs
« Last Edit: October 10, 2016, 11:33:29 am by Thaddy »
When you ask a question that is actually answered in the documentation, you are either lazy or a moron.

Thaddy

  • Hero Member
  • *****
  • Posts: 10482
Re: cannot link lua52
« Reply #5 on: October 10, 2016, 11:35:54 am »
Also check that the library name in lua52.pas is liblua5.2.so and not liblua52.so In my version it was wrong.
I got that here: https://github.com/severak/svlad2/blob/master/lua52.pas so it is your own file....

After that it compiles ;) Nice, btw
« Last Edit: October 10, 2016, 12:05:54 pm by Thaddy »
When you ask a question that is actually answered in the documentation, you are either lazy or a moron.

Severak

  • Newbie
  • Posts: 3
Re: cannot link lua52
« Reply #6 on: October 13, 2016, 12:00:59 am »
Thaddy: Thanks for help. Your solution works well.

Thaddy

  • Hero Member
  • *****
  • Posts: 10482
Re: cannot link lua52
« Reply #7 on: October 13, 2016, 04:16:21 pm »
Thaddy: Thanks for help. Your solution works well.

Tnx for the code. At some point I plan to use it!
Glad to be of help.
When you ask a question that is actually answered in the documentation, you are either lazy or a moron.

 

TinyPortal © 2005-2018