Recent

Author Topic: Error while linking (Ubuntu)  (Read 16513 times)

mdalacu

  • Full Member
  • ***
  • Posts: 233
    • dmSimpleApps
Re: Error while linking (Ubuntu)
« Reply #15 on: December 18, 2017, 07:50:15 am »
I am using it without problems on Ubuntu 17.10 x64 Lazarus 1.8 and fpc 3.0.4 on 2 machines.
I have install it using fpcupdeluxe.

Handoko

  • Hero Member
  • *****
  • Posts: 5154
  • My goal: build my own game engine using Lazarus
Re: Error while linking (Ubuntu)
« Reply #16 on: December 18, 2017, 02:28:31 pm »
@MikeFinch

I think the thing that caused the failure is the absent of gtk2-devel package (lib64gtk+2.0-devel).

Today I downloaded and installed Mageia 6 64-bit, then I continued to install Lazarus. Both fpc-3.0.4-1.x86_64.rpm and fpc-src-3.0.4-1.x86_64.rpm were successfully installed but its failed when installing lazarus-1.8.0-0.x86_64.rpm.

Information about how to instal gtk2-devel on Mageia is hard to find on the internet. I found one, but the download failed:
http://rpm.pbone.net/index.php3/stat/4/idpl/41764743/dir/mageia_other/com/lib64gtk+2.0-devel-2.24.31-3.mga6.x86_64.rpm.html

Because I am not familiar with Mageia and the information to install gtk2-devel is hard to find, nothing much I can do now.

Have your Mageia have lib64gtk+2.0-devel properly installed?

MikeFinch

  • Jr. Member
  • **
  • Posts: 79
Re: Error while linking (Ubuntu)
« Reply #17 on: December 21, 2017, 08:19:28 am »
Handoko >> took me a while to realise that you were on Page 2!

I tried to urpmi the file and got >>
"Package lib64gtk+2.0-devel-2.24.31-3.mga6.x86_64 is already installed
Marking lib64gtk+2.0-devel as manually installed, it won't be auto-orphaned
writing /var/lib/rpm/installed-through-deps.list".

Where to now?

I have never understood why, under Project / Compiler Options / Config and Target there is a line in purple/blue which after 'Current LCL widgetset: "gtk2"' says "Select another LCL widgetset (macro LCLWidgetType)". Am I supposed to change something and is this relevant to the problem?

You have also mentioned "gtk2-devel".

MikeFinch

Handoko

  • Hero Member
  • *****
  • Posts: 5154
  • My goal: build my own game engine using Lazarus
Re: Error while linking (Ubuntu)
« Reply #18 on: December 21, 2017, 08:59:38 am »
I have never understood why, under Project / Compiler Options / Config and Target there is a line in purple/blue which after 'Current LCL widgetset: "gtk2"' says "Select another LCL widgetset (macro LCLWidgetType)". Am I supposed to change something and is this relevant to the problem?

It think you managed to install Lazarus correctly. About the message: "Select another LCL widgetset (macro LCLWidgetType)", you can simply ignore it. It just telling you that you can change the widgetset by clicking that blue text.

What you should do now is make sure your Lazarus is working correctly. You can start a new empty project, put some buttons, compile and run it. Or open some of your older projects and run them.

mknau

  • Newbie
  • Posts: 1
Re: Error while linking (Ubuntu)
« Reply #19 on: December 22, 2017, 10:50:07 pm »
Probably this may helps:

I had Lazarus 1.6.4 (fpc 3.0.2) installed (CentOS 7) and it was no problem with linking.
after upgrade to Lazarus 1.8.8 (fpc 3.0.4) the same working project gives "Error while linking" without any specific error message.
Dwngrade back to 1.6.4 (fpc 3.0.2)  and miracle... everything is back.
so 3.0.2 was 100% Ok but 3.0.4 gives a problem.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11453
  • FPC developer.
Re: Error while linking (Ubuntu)
« Reply #20 on: December 22, 2017, 11:21:31 pm »
Yeah, RPMs for 3.0.4 are linked on a newer distro, causing some problems on older ones. https://bugs.freepascal.org/view.php?id=32251

MikeFinch

  • Jr. Member
  • **
  • Posts: 79
Re: Error while linking (Ubuntu)
« Reply #21 on: December 23, 2017, 01:23:55 am »
Handoko >> I reported to you previously about an older project giving the identical "Error while linking" error.

So now I created the most simple of projects : a form with a button on it!

Result? Exactly the same problem; except that the first time I ran it it gave four hints. (Sorry : didn't record them).

The second time I simply get the first line with a red background and the second with the blue-bg error message.

WHY DOES THE LINUX VERSION GIVE THIS LINKING ERROR  WHEN RC05 DIDN'T?

BTW : the above is with my Desktop - my laptop gives (between the red and blue lines) >>
" MSPairings.LPR(54,1) Warning: "crtbeginS.o" not found, this will probably cause a linking failure
  MSPairings.LPR(54,1) Warning: "crtendS.o" not found, this will probably cause a linking failure"

I seem to remember this happened in RC05 but the program linked successfully anyway.

Is this a clue to the problem? marcov and mknau are hinting that there is something amiss in fpc3.0.4 ......  :(

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Error while linking (Ubuntu)
« Reply #22 on: December 23, 2017, 01:50:28 am »
Is this a clue to the problem? marcov and mknau are hinting that there is something amiss in fpc3.0.4 ......  :(
As far as i was able to understand: there is nothing amiss with fpc 3.0.4 release. FPC requires newer binutils (for certain targets ?) . That seems to cause issues for/on older systems.

Handoko

  • Hero Member
  • *****
  • Posts: 5154
  • My goal: build my own game engine using Lazarus
Re: Error while linking (Ubuntu)
« Reply #23 on: December 23, 2017, 03:38:23 am »
@MikeFinch

Can you tell how to install lib64gtk+2.0-devel on Mageia 6? I can't find it.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11453
  • FPC developer.
Re: Error while linking (Ubuntu)
« Reply #24 on: December 23, 2017, 05:34:09 pm »
Is this a clue to the problem? marcov and mknau are hinting that there is something amiss in fpc3.0.4 ......  :(
As far as i was able to understand: there is nothing amiss with fpc 3.0.4 release. FPC requires newer binutils (for certain targets ?) . That seems to cause issues for/on older systems.

It is not the 3.0.4 release or anything in it, but the way the binary release was built (on a new system).
The linker uses features only support on newer systems.

Keep in mind that on *nix there is no such thing as a guaranteedly portable binary.

MikeFinch

  • Jr. Member
  • **
  • Posts: 79
Re: Error while linking (Ubuntu)
« Reply #25 on: December 23, 2017, 10:59:44 pm »
Handoko and all : presumably lib64gtk came with the iso/installation file for Mageia 6[?]. Basically, I don't know!

What is this talk about newer/older distros/systems? Can you please elucidate?

Mageia 6 is the latest version and appeared in the middle of 2017 and the kernel is regularly updated of course.

Should I be raising this problem on the Mageia forum?

I am a simple programmer and don't understand deeper technical issues. Don't forget > RC05 was perfectly well-behaved (apart from the quirks I have mentioned).  %)

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Error while linking (Ubuntu)
« Reply #26 on: December 23, 2017, 11:55:54 pm »
@marcov:
ah, that leaves me with a better understanding. Thank you very much !

@MikeFinch
Perhaps i used some wrong words in my previous reply. Let me try again with renewed knowledge from marcov ...

The RTL requires startup-files. These were compiled on a system that has newer binutils installed. These newer binutils make use of features that older binutils don't understand. As a (very poor) analogy: you can't compile your state of the art Free Pascal code with Turbo-Pascal, as there are constructs and features in Free Pascal that Turbo-Pascal does not understand.

That is what marcov (also) meant with "Keep in mind that on *nix there is no such thing as a guaranteedly portable binary.". (mark the words binary, not source as used in my poor analogy).

In theory that statement is true for _any_ release of FPC and applicable for _every_ platform (for instance users targeting android were already confronted by the need for updating their use of binutils in the past).

The person who compiled the FPC distro for you (and that you downloaded/installed) simply has a 'newer' system (i should have written "updated" in my previous post as well as right now) system then yours. Therefor some of the produced files simply don't match, and seem to cause current issues that you experience.

afaik: Either update your binutils or apply the pre binutils compiled startup files as mentioned by Pierre on related mantis report.
« Last Edit: December 24, 2017, 12:04:27 am by molly »

MikeFinch

  • Jr. Member
  • **
  • Posts: 79
Re: Error while linking (Ubuntu)
« Reply #27 on: December 24, 2017, 01:16:58 pm »
Wait a minute -- isn't the fpc304 source code part of the installation/compiling process?
And I'm afraid you will have to be clearer where and what/which binutils you mean!
I don't recollect having had this sort of problem before  :(
IOW it's a new one to me .....

Handoko

  • Hero Member
  • *****
  • Posts: 5154
  • My goal: build my own game engine using Lazarus
Re: Error while linking (Ubuntu)
« Reply #28 on: December 24, 2017, 07:59:12 pm »
Any news?

Handoko and all : presumably lib64gtk came with the iso/installation file for Mageia 6[?]. Basically, I don't know!

What is this talk about newer/older distros/systems? Can you please elucidate?
I tested the installation on Mageia 6 64-bit KDE Desktop. The installation failed with error "... unsatisfied gtk2-devel". The gtk2-devel was no where to be found on the KDE Desktop.

Today I tested the installation again but on Mageia 6 64-bit Gnome Desktop. It failed, the message was "... unstisfied /usr/bin/make").
« Last Edit: December 24, 2017, 08:01:13 pm by Handoko »

dicepd

  • Full Member
  • ***
  • Posts: 163
Re: Error while linking (Ubuntu)
« Reply #29 on: December 24, 2017, 09:28:41 pm »
I reported this back in august
https://forum.lazarus.freepascal.org/index.php/topic,37916.msg256217.html#msg256217

Upgrading binutils can break other parts of your distro, as I found out to my cost of a quite a few wasted hours,, so I have used  fpcupdeluxe ever since on my machines, 10+ installs already along with the benefit of running multiple versions with ease.
Lazarus 1.8rc5 Win64 / Linux gtk2 64 / FreeBSD qt4

 

TinyPortal © 2005-2018