Recent

Author Topic: "Error while linking" in Ubuntu  (Read 3054 times)

Edson

  • Hero Member
  • *****
  • Posts: 1056
"Error while linking" in Ubuntu
« on: July 14, 2018, 01:42:10 am »
Hi

just installed FPC/Lazarus in a virtual Ubuntu 15. Installed using *.deb from https://www.lazarus-ide.org/

Now when compiling an empty project, have the error:

/usr/bin/ld: /usr/lib/fpc/3.0.4/units/x86_64-linux/rtl/cprt0.o: unrecognized relocation (0x2a) in section `.text'
Lazarus 1.6 - FPC 3.0.0 - x86_64-win64 on  Windows 7

Phil

  • Hero Member
  • *****
  • Posts: 2750
Re: "Error while linking" in Ubuntu
« Reply #1 on: July 14, 2018, 02:06:59 am »

VTwin

  • Hero Member
  • *****
  • Posts: 793
  • Former Turbo Pascal 3 user
Re: "Error while linking" in Ubuntu
« Reply #2 on: July 14, 2018, 02:28:11 am »
This may not be helpful, but I have multiple installations of Lazarus 1.8.4 on Ubuntu 16 installed in VirtualBox from deb files that run fine. I don't have any information on your error messages however.

I install the following:

  fpc_3.0.4-2_amd64.deb
  fpc-src_3.0.4-2_amd64.deb
  lazarus-project_1.8.4-0_amd64.deb

It has worked well for me.

Cheers,
VTwin

EDIT: I assume Ubuntu 64 bit?
« Last Edit: July 14, 2018, 02:41:03 am by VTwin »
“Talk is cheap. Show me the code.” -Linus Torvalds

macOS 10.13.6: Lazarus 2.0.7 fixes svn 62300 (64 bit Cocoa)
Ubuntu 18.04.3: Lazarus 2.0.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.0.6 (64 bit on VBox)
fpc 3.0.4

Edson

  • Hero Member
  • *****
  • Posts: 1056
Re: "Error while linking" in Ubuntu
« Reply #3 on: July 14, 2018, 02:48:50 am »
I see this:
http://free-pascal-general.1045716.n5.nabble.com/Linker-error-td5723410.html
Thanks Phill. I've saw this before but doen't help me.

I have multiple installations of Lazarus 1.8.4 on Ubuntu 16 installed in VirtualBox from deb files that run fine. I don't have any information on your error messages however.

I install the following:

  fpc_3.0.4-2_amd64.deb
  fpc-src_3.0.4-2_amd64.deb
  lazarus-project_1.8.4-0_amd64.deb

It has worked well for me.

I've installed the same *.deb but not working. 
Yes I've Ubuntu 64 bits, but the version 15.
What version of gcc you have? I've upgraded to gcc 5, but get the same error.

Lazarus 1.6 - FPC 3.0.0 - x86_64-win64 on  Windows 7

VTwin

  • Hero Member
  • *****
  • Posts: 793
  • Former Turbo Pascal 3 user
Re: "Error while linking" in Ubuntu
« Reply #4 on: July 14, 2018, 03:38:10 am »
It looks like 7.11.1. I made no changes from the default installation.

EDIT: You said gcc, not gdb, I'm confused. I could be wrong , but I don't think gcc has any significance here.
 
« Last Edit: July 14, 2018, 03:51:14 am by VTwin »
“Talk is cheap. Show me the code.” -Linus Torvalds

macOS 10.13.6: Lazarus 2.0.7 fixes svn 62300 (64 bit Cocoa)
Ubuntu 18.04.3: Lazarus 2.0.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.0.6 (64 bit on VBox)
fpc 3.0.4

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5784
    • wiki
Re: "Error while linking" in Ubuntu
« Reply #5 on: July 14, 2018, 03:48:39 am »
Afaik (reading the linked description) you need to update "ld" -> according to the link, that is binutils

Edson

  • Hero Member
  • *****
  • Posts: 1056
Re: "Error while linking" in Ubuntu
« Reply #6 on: July 14, 2018, 05:05:42 am »
Afaik (reading the linked description) you need to update "ld" -> according to the link, that is binutils

Hi Martin.

I'm triying to update binutils to 2.30, but my Ubuntu says I need libc6 >= 2.27, and I have 2.21.

Then when I try to update "libc6", it says "break existing package libc-bin dependency < 2.22".

EDIT: Even when trying isntall binutils 2.26 (I have 2.25) with:

Quote
sudo apt-get install binutils-2.26

I get:

Quote
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package binutils-2.26
E: Couldn't find any package by regex 'binutils-2.26'
« Last Edit: July 14, 2018, 05:20:24 am by Edson »
Lazarus 1.6 - FPC 3.0.0 - x86_64-win64 on  Windows 7

Handoko

  • Hero Member
  • *****
  • Posts: 3233
  • My goal: build my own game engine using Lazarus
Re: "Error while linking" in Ubuntu
« Reply #7 on: July 14, 2018, 08:13:44 am »
just installed FPC/Lazarus in a virtual Ubuntu 15.

Maybe you can consider to use newer versions of Ubuntu. Ubuntu 15 is not a LTS (long-term support) release, its support has expired on July 2016. You will be difficult to upgrade certain packages when using unsupported version. Current stable version of Ubuntu is 18.04 LTS.

I checked binutils package for Ubuntu, none of them is available for Ubuntu 15:
https://packages.ubuntu.com/search?keywords=binutils

Edson

  • Hero Member
  • *****
  • Posts: 1056
Re: "Error while linking" in Ubuntu
« Reply #8 on: July 14, 2018, 06:01:43 pm »
just installed FPC/Lazarus in a virtual Ubuntu 15.

Maybe you can consider to use newer versions of Ubuntu. Ubuntu 15 is not a LTS (long-term support) release, its support has expired on July 2016. You will be difficult to upgrade certain packages when using unsupported version. Current stable version of Ubuntu is 18.04 LTS.

I checked binutils package for Ubuntu, none of them is available for Ubuntu 15:
https://packages.ubuntu.com/search?keywords=binutils

OK. I will update to a newer version.
Lazarus 1.6 - FPC 3.0.0 - x86_64-win64 on  Windows 7