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
/usr/bin/ld.bfd: cannot find -lxml2
/usr/bin/ld.bfd: cannot find -lxslt
Error: (9013) Error while linking
So installing
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.lprThen, 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.