Recent

Author Topic: crtbeginS.o and crtendS.o not found this will probably cause a linking failure  (Read 1158 times)

Aruna

  • Hero Member
  • *****
  • Posts: 644
Hello everyone, I just installed Lazarus IDE onto a fresh clean pristine installation of Debian Linux and tried to compile a empty project just to make sure everything works as expected. Everything does work but I get two error messages. Screenshot attached shows the errors. How do I make them go away?

paule32

  • Hero Member
  • *****
  • Posts: 516
  • One in all. But, not all in one.
I faced this by using the gcc.exe - the gnu proxy to cc.exe when the path's not set (maybe on -nostdlib, too).

Check, if you use a clean/valid fpc.ini.
MS-IIS - Internet Information Server, Apache, PHP/HTML/CSS, MinGW-32/64 MSys2 GNU C/C++ 13 (-stdc++20), FPC 3.2.2
A Friend in need, is a Friend indeed.

munair

  • Hero Member
  • *****
  • Posts: 883
  • compiler developer @SharpBASIC
    • SharpBASIC
It's only logical.

TRon

  • Hero Member
  • *****
  • Posts: 4377
Everything does work but I get two error messages. Screenshot attached shows the errors. How do I make them go away?
In the fpc.cfg used by the compiler is an entry that looks something like:
Code: [Select]
# path to the gcclib
#ifdef cpui386
-Fl/usr/lib/gcc/x86_64-linux-gnu/12
#endif
#ifdef cpux86_64
-Fl/usr/lib/gcc/x86_64-linux-gnu/12
#endif

Note the number at the end. This number as well as the location of the gcc dependencies might be located in another directory on your system. I am not that familiar with gcc to know if there is a default way to determine the exact location (there probably is one).

If not mistaken then usually package build-essential (debian based distros at least) takes care of retrieving these dependencies.
Today is tomorrow's yesterday.

Lutz Mändle

  • Jr. Member
  • **
  • Posts: 74
The command

gcc --print-libgcc-file-name

prints the path for the actual gcc installation.
On opensuse tumbleweed (64 bit) it gives:
/usr/lib64/gcc/x86_64-suse-linux/14/libgcc.a

The -Fl option in the fpc.cfg needs only the path without libgcc.a .

TRon

  • Hero Member
  • *****
  • Posts: 4377
* TRon tips hat to Lutz
Today is tomorrow's yesterday.

Aruna

  • Hero Member
  • *****
  • Posts: 644
Hi, @munair @Tron and @Lutz thank you so much everyone. Strangely in my /etc/fpc.cfg the # path to the gcclib was empty.

So I plugged this in and the warnings went away:

Code: Text  [Select][+][-]
  1. #ifdef cpui386
  2. -Fl/usr/lib/gcc/x86_64-linux-gnu/12
  3. #endif
  4. #ifdef cpux86_64
  5. -Fl/usr/lib/gcc/x86_64-linux-gnu/12
  6. #endif

Once again many thanks to all for the guidance and help.

munair

  • Hero Member
  • *****
  • Posts: 883
  • compiler developer @SharpBASIC
    • SharpBASIC
You're welcome. Whenever your GCC gets updated, be sure to adjust the version number in fpc.cfg.
It's only logical.

cdbc

  • Hero Member
  • *****
  • Posts: 2206
    • http://www.cdbc.dk
Hi
@Munair: +1 =^
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 3.6 up until Jan 2024 from then on it's both above &: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 4.99

PeterBB

  • Jr. Member
  • **
  • Posts: 71
Whenever your GCC gets updated, be sure to adjust the version number in fpc.cfg.

And there is a tool, fpcmkcfg. that can do this for you.


Cheers,
Peter

arnoldpa

  • New member
  • *
  • Posts: 7
Quote

And there is a tool, fpcmkcfg. that can do this for you.


Cheers,
Peter

I've been having the same warning also. Thanks for the tip.

 

TinyPortal © 2005-2018