Recent

Author Topic: Error while linking [SOLVED]  (Read 17489 times)

cpicanco

  • Sr. Member
  • ****
  • Posts: 465
    • My Portfolio
Re: Error while linking
« Reply #15 on: July 25, 2017, 10:57:54 pm »
@odvesims, please take a look here: https://forum.lazarus.freepascal.org/index.php?topic=30529.30

It may help you.

My guess is that you must compile the 3.1.1 with a 3.0.X version. But it is a guess.

odvesims

  • Full Member
  • ***
  • Posts: 176
Re: Error while linking
« Reply #16 on: July 25, 2017, 11:34:15 pm »
@odvesims, please take a look here: https://forum.lazarus.freepascal.org/index.php?topic=30529.30

It may help you.

My guess is that you must compile the 3.1.1 with a 3.0.X version. But it is a guess.

I have version 3.1.1 . I tried doing this:

The following fixed the issue for me.

Code: Bash  [Select][+][-]
  1. cd /usr/share/fpcsrc/3.0.3
  2. sudo make clean all OS_TARGET=linux CPU_TARGET=x86_64
  3. sudo make install OS_TARGET=linux CPU_TARGET=x86_64 INSTALL_PREFIX=/usr
  4.  

However its throwing a "*** The only supported starting compiler version is 3.0.0. You are trying to build with 3.1.1.. Stop".

cpicanco

  • Sr. Member
  • ****
  • Posts: 465
    • My Portfolio
Re: Error while linking
« Reply #17 on: July 26, 2017, 03:40:50 am »
Sorry, I am afraid I can't help you further. If I were in your place, I would research about the release enginnering:

http://wiki.freepascal.org/Release_engineering 

odvesims

  • Full Member
  • ***
  • Posts: 176
Re: Error while linking
« Reply #18 on: July 26, 2017, 09:09:48 pm »
Okay so I got it fixed. The "linking" error was caused by some libraries that weren't compatible with my linux distribution. The IDE wasn't throwing any library-related error when compiling, and it wasn't pointing to any library in particular. What I did was the following:

1- Removed all units from the project inspector
2- Add them again
3- Do a clean/build of the IDE (I'm inclined to believe this was the ONLY thing needed, but I'd clean/built it before and nothing changed so I'm not 100% sure)

After trying to compile (following the clean/build) the IDE was showing me exactly which libraries were causing the linking issue. Wrapping things between {$IFDEF WINDOWS}{ENDIF} did the trick. The "error while linking" is no longer an issue.

cpicanco

  • Sr. Member
  • ****
  • Posts: 465
    • My Portfolio
Re: Error while linking [SOLVED]
« Reply #19 on: July 26, 2017, 09:58:46 pm »
Excelent! Much simpler than the linking error faced by me.

cd

  • Jr. Member
  • **
  • Posts: 54
Re: Error while linking [SOLVED]
« Reply #20 on: December 19, 2018, 12:27:08 pm »
To anyone who came here to get some hints on getting rid of "Error while linking".

Build your project from command line by the lazbuild utility.

This will show all the linker errors that are not parsed by the IDE and thus not shown there. In my case these were

Code: Bash  [Select][+][-]
  1. /usr/bin/ld.bfd: cannot find -lxml2
  2. /usr/bin/ld.bfd: cannot find -lxslt
  3. Error: (9013) Error while linking

So installing
Code: Bash  [Select][+][-]
  1. apt-get install libxml2-dev libxslt1-dev
fixed the problem.

Awesome Programmer

  • Sr. Member
  • ****
  • Posts: 426
  • Programming is FUN only when it works :)
    • Cool Technology
Re: Error while linking [SOLVED]
« Reply #21 on: December 18, 2019, 06:25:22 pm »
To anyone who came here to get some hints on getting rid of "Error while linking".

Build your project from command line by the lazbuild utility.

This will show all the linker errors that are not parsed by the IDE and thus not shown there. In my case these were

Code: Bash  [Select][+][-]
  1. /usr/bin/ld.bfd: cannot find -lxml2
  2. /usr/bin/ld.bfd: cannot find -lxslt
  3. Error: (9013) Error while linking

So installing
Code: Bash  [Select][+][-]
  1. apt-get install libxml2-dev libxslt1-dev
fixed the problem.

 :)
Awesome... I ran into this issue just recently and I build my project files using LazBuild command on the terminal. It displayed what the issue was along with the Error While Linking.
Simply, ran the following command on the terminal as follows. lazbuild -B name-of-your-project.lpr
Then, whatever your issue is you may have to Clean + Build your project files and Lazarus compiler. That's what I had to do for the error to go away. But please please make sure that you have all the Ts and Xs crossed and checked before you actually CLEAN and BUILD your project. Couple of months ago, I cleaned and build up my project without making sure what this process was going to do. It not only deleted all the compiled files with extensions O, PPL, PPU, OR, but also my project files LFM, PAS, LRS files destorying all the latest updates and changes I made to my software. Luckily, I had a backup that was only 5 days old. So, watch when you CLEAN and BUILD your project files.

Chris_h174

  • New Member
  • *
  • Posts: 13
Re: Error while linking [SOLVED]
« Reply #22 on: September 10, 2020, 10:51:03 am »
I had the same problem after someone sent me a project to test a problem, and I found that selecting "Release" Build Mode allowed me to compile.
That's not very helpful when you want to debug so I looked further and found that un-checking "Use external gdb debug symbols file (-Xg)" allowed me to compile with debugging.
I guess that's not as good as the solution above but if you need to make progress it could be a god-send?
Chris
Chris
Lazarus 2.0.2 fpc3.0.4 on OpenSuse Leap 15.1 and Win7_64.

del

  • Full Member
  • ***
  • Posts: 200
Re: Error while linking [SOLVED]
« Reply #23 on: March 04, 2021, 02:19:53 am »
To anyone who came here to get some hints on getting rid of "Error while linking".

Build your project from command line by the lazbuild utility.

This will show all the linker errors that are not parsed by the IDE and thus not shown there. In my case these were

Code: Bash  [Select][+][-]
  1. /usr/bin/ld.bfd: cannot find -lxml2
  2. /usr/bin/ld.bfd: cannot find -lxslt
  3. Error: (9013) Error while linking

So installing
Code: Bash  [Select][+][-]
  1. apt-get install libxml2-dev libxslt1-dev
fixed the problem.
Worked for me too. Lifesaver. Just an FYI and Thank You.

 

TinyPortal © 2005-2018