Recent

Author Topic: SOLVED: Warning: "crtbegin.o" not found, this will probably ca  (Read 8932 times)

Thaddy

  • Hero Member
  • *****
  • Posts: 18376
  • Here stood a man who saw the Elbe and jumped it.
Re: SOLVED: Warning: "crtbegin.o" not found, this will probably ca
« Reply #15 on: May 06, 2025, 02:09:00 pm »
@cdbc
Yes, that's it  :D Great fan for many years, Have most of their old records...
First met them when I was at my student society. They were playing at us and I had to may them 6500 guilders back in the eighties. (Questor Societeit)
They blew the roof off. Yhey are apparently from Durroemm, what ever that means. (Maybe Durham?) Incompehenceble dialect. Nice tele, though, I played it! (Since Nelly is a girl, I hope I did not offend the lhgbt community)

Off to the circus with that one. Btw It is a much older English child song, but you knew that.
« Last Edit: May 06, 2025, 02:17:22 pm by Thaddy »
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: SOLVED: Warning: "crtbegin.o" not found, this will probably ca
« Reply #16 on: May 06, 2025, 07:40:03 pm »
On linux it won't occur afaik.
fyi it can and will. Nothing a little nudge is able to solve though.
Today is tomorrow's yesterday.

munair

  • Hero Member
  • *****
  • Posts: 887
  • compiler developer @SharpBASIC
    • SharpBASIC
Re: SOLVED: Warning: "crtbegin.o" not found, this will probably ca
« Reply #17 on: May 10, 2025, 09:18:04 am »
The "problem" is just windows related if there are no clibs in the path.
On linux it won't occur afaik.
The topic started out with the problem and fix on Linux.
It's only logical.

Thaddy

  • Hero Member
  • *****
  • Posts: 18376
  • Here stood a man who saw the Elbe and jumped it.
Re: SOLVED: Warning: "crtbegin.o" not found, this will probably ca
« Reply #18 on: May 10, 2025, 11:07:28 am »
Then he had no correct install anyway.
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

lazer

  • Sr. Member
  • ****
  • Posts: 269
Re: SOLVED: Warning: "crtbegin.o" not found, this will probably ca
« Reply #19 on: September 01, 2025, 01:22:00 pm »
I'm having the crtbegin.o issue too.

It's been a while but I had laz and fpc working nicely on fedora 40.  Since I've just updated to Fed42 and wanted to pick up some laz project I had worked on before.

Of course, some things don't work any more :(
My project compiles but uos sound library does not load. In digging into this I noticed crtbegin warning.

My /etc/fpc,cfg looks a little different to some posted above in that it does not have hardcoded version numbers (thankfully).

Code: Pascal  [Select][+][-]
  1. # searchpath for libraries
  2. #IFDEF CPU64
  3. #-Fl/usr/lib64/fpc/$fpcversion/lib
  4. #-Fl/lib64;/usr/lib64
  5. -Fl/usr/lib64/fpc/$fpcversion/lib/$FPCTARGET
  6. #ELSE
  7. #-Fl/usr/lib/fpc/$fpcversion/lib
  8. #-Fl/lib;/usr/lib
  9. -Fl/usr/lib/fpc/$fpcversion/lib/$FPCTARGET
  10. #ENDIF
  11.  
  12. # searchpath for tools
  13. #IFDEF CPU64
  14. -FD/usr/lib64/fpc/$fpcversion/bin/$FPCTARGET
  15. #ELSE
  16. -FD/usr/lib/fpc/$fpcversion/bin/$FPCTARGET
  17. #ENDIF
  18.  

Now, using distro's fpc
Code: Pascal  [Select][+][-]
  1. $ fpc -v
  2. Free Pascal Compiler version 3.2.2 [2025/05/10] for x86_64
  3.  

I do find /usr/lib64/fpc/$fpcversion/  but there is no lib or bin.

Code: Pascal  [Select][+][-]
  1. $ ls /usr/lib64/fpc/3.2.2
  2. fpmkinst  msg  ppcx64  samplecfg  units
  3.  

I don't know where lib and bin went  but lazarus seems to build and run my program without any problem except for the missing sound.

this is where it is failing:
Code: Pascal  [Select][+][-]
  1.  //function uos_loadlib(PortAudioFileName, SndFileFileName, Mpg123FileName, Mp4ffFileName, FaadFileName,  opusfilefilename: PChar) : LongInt;
  2.   res:=0;
  3.   res := uos_LoadLib(PChar(PA_FileName), PChar(SF_FileName), nil, Nil, Nil, Nil);
  4.  
  5.   if res <> 0 then
  6.     errdisp('sound libraries did not load.',strNotxt,mb_excl)   // add to translated strings in pack.pas ???
  7.   else
  8.   begin
  9.  

Is that related to the crtbegin.o warning or am I running around in circles here?

TIA.

Thaddy

  • Hero Member
  • *****
  • Posts: 18376
  • Here stood a man who saw the Elbe and jumped it.
Re: SOLVED: Warning: "crtbegin.o" not found, this will probably ca
« Reply #20 on: September 01, 2025, 01:46:42 pm »
Add -Fl/usr/lib/gcc/x86_64-linux-gnu/13 (on my machine)
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

Lutz Mändle

  • Jr. Member
  • **
  • Posts: 83
Re: SOLVED: Warning: "crtbegin.o" not found, this will probably ca
« Reply #21 on: September 01, 2025, 02:00:32 pm »
The path for the -Fl option in fpc.cfg can requested from gcc with the command
gcc --print-libgcc-file-name

On actual opensuse Tumbleweed it gives
/usr/lib64/gcc/x86_64-suse-linux/15/libgcc.a

From this answer copy only the directory part to the -Fl option.

lazer

  • Sr. Member
  • ****
  • Posts: 269
Re: SOLVED: Warning: "crtbegin.o" not found, this will probably ca
« Reply #22 on: September 01, 2025, 05:07:40 pm »
Thanks folks.  That seems to have fixed the crtbegin.o  issue.

Sadly still no sound.  Looks like I'm in for a day's worth of debugging to straighten that out.

Thaddy

  • Hero Member
  • *****
  • Posts: 18376
  • Here stood a man who saw the Elbe and jumped it.
Re: SOLVED: Warning: "crtbegin.o" not found, this will probably ca
« Reply #23 on: September 01, 2025, 05:20:07 pm »
gcc --print-libgcc-file-name
Indeed, great to find the path part.
That's a neat trick I did not know. And it works on multiple debians/ubuntu too.
Should be in the wiki...
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

cdbc

  • Hero Member
  • *****
  • Posts: 2477
    • http://www.cdbc.dk
Re: SOLVED: Warning: "crtbegin.o" not found, this will probably ca
« Reply #24 on: September 01, 2025, 05:23:14 pm »
Hi
Quote
That's a neat trick I did not know. And it works on multiple debians/ubuntu too.
Should be in the wiki...
+1
Works on PCLinuxOS too -- Me Likey  :D
Yup, somebody please put it in the wiki...
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6 -> FPC 3.2.2 -> Lazarus 4.0 up until Jan 2025 from then on it's both above &: KDE6/QT6 -> FPC 3.3.1 -> Lazarus 4.99

lazer

  • Sr. Member
  • ****
  • Posts: 269
Re: SOLVED: Warning: "crtbegin.o" not found, this will probably ca
« Reply #25 on: September 02, 2025, 09:24:13 am »
Yup, somebody please put it in the wiki...

How about someone puts in the fpc.cfg so we don't have to screw about trawling forums ?

Thausand

  • Sr. Member
  • ****
  • Posts: 407
Re: SOLVED: Warning: "crtbegin.o" not found, this will probably ca
« Reply #26 on: September 02, 2025, 09:29:13 am »
How about someone puts in the fpc.cfg so we don't have to screw about trawling forums ?
fpc.cfg no can execute program so not work.

Thaddy

  • Hero Member
  • *****
  • Posts: 18376
  • Here stood a man who saw the Elbe and jumped it.
Re: SOLVED: Warning: "crtbegin.o" not found, this will probably ca
« Reply #27 on: September 02, 2025, 09:43:10 am »
How about someone puts in the fpc.cfg so we don't have to screw about trawling forums ?
That is unlikely since it depends on the GNU version that is installed on your system.
What is possible is that an installer writes that line based on the tip given above.
Then again, i lived for years simply ignoring the crtbegin/end messages on some systems.
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

lazer

  • Sr. Member
  • ****
  • Posts: 269
Re: SOLVED: Warning: "crtbegin.o" not found, this will probably ca
« Reply #28 on: September 02, 2025, 10:11:52 am »
There does not seem to be any scripting in fpc.cfg but some variables are apparently sniffed higher up and passed to it.
Code: Pascal  [Select][+][-]
  1. #IFDEF CPU64
  2. -Fu/usr/lib64/fpc/$fpcversion/units/$fpctarget
  3. -Fu/usr/lib64/fpc/$fpcversion/units/$fpctarget/*
  4. -Fu/usr/lib64/fpc/$fpcversion/units/$fpctarget/rtl
  5.  

Presumably it could do something like:
Code: Pascal  [Select][+][-]
  1. # searchpath for libraries
  2. #IFDEF CPU64
  3. #-Fl/usr/lib64/fpc/$fpcversion/lib
  4. #-Fl/lib64;/usr/lib64
  5. -Fl/usr/lib64/fpc/$fpcversion/lib/$FPCTARGET
  6.  
  7. # find glibc path:  gcc --print-libgcc-file-name
  8. -Fl/usr/lib/gcc/$gcctarget/$gccversion
  9.  

Quote
Then again, i lived for years simply ignoring the crtbegin/end messages on some systems.
Oh, so this is a total red herring anyway?
« Last Edit: September 02, 2025, 10:16:11 am by lazer »

Thausand

  • Sr. Member
  • ****
  • Posts: 407
Re: SOLVED: Warning: "crtbegin.o" not found, this will probably ca
« Reply #29 on: September 02, 2025, 10:17:35 am »
Presumably it could do something like:
Yes, can have. Envar can use in fpc.cfg. I do with fpc script make them then have run fpc executable.

Quote
Oh, so this is a total red herring anyway?
Not if work depend heavy on c when need crt function(s) or OS/platform depend for it. So for "normal" work it no really matter afaik

 

TinyPortal © 2005-2018