Recent

Author Topic: [SOLVED] crtbeginS.o crtendS.o not found warnings  (Read 20419 times)

cpicanco

  • Hero Member
  • *****
  • Posts: 618
  • Behavioral Scientist and Programmer
    • Portfolio
[SOLVED] crtbeginS.o crtendS.o not found warnings
« on: October 04, 2016, 07:33:36 pm »
Hi all,

How can I properly resolve the following warning?

Quote
pupil_sync.lpr(21,1) Warning: "crtbeginS.o" not found, this will probably cause a linking failure
pupil_sync.lpr(21,1) Warning: "crtendS.o" not found, this will probably cause a linking failure
Best Regards,
Rafael
« Last Edit: October 11, 2016, 11:04:57 pm by cpicanco »
Be mindful and excellent with each other.
https://github.com/cpicanco/

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: crtbeginS.o crtendS.o not found warnings
« Reply #1 on: October 04, 2016, 09:27:06 pm »
Install these files.

They come with the development part of your distribution, usually, build-essentials or glibc-devel or so.

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: crtbeginS.o crtendS.o not found warnings
« Reply #2 on: October 04, 2016, 11:48:43 pm »
And what about crti.o and crtn.o, the same warnings..

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: crtbeginS.o crtendS.o not found warnings
« Reply #3 on: October 05, 2016, 12:02:36 am »
@lainz:
Those are the same libc related errors. Your (target) platform (sdk) provides these. Usually path related or, in case of cross-compiling you need to copy these over to your host platform.

See also command line options:
Quote
-Fl<x>     Add <x> to library path 
-Fo<x>     Add <x> to object path 

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: crtbeginS.o crtendS.o not found warnings
« Reply #4 on: October 05, 2016, 12:15:19 am »
@lainz:
Those are the same libc related errors. Your (target) platform (sdk) provides these. Usually path related or, in case of cross-compiling you need to copy these over to your host platform.

See also command line options:
Quote
-Fl<x>     Add <x> to library path 
-Fo<x>     Add <x> to object path 

Thanks. I found the file here in Ubuntu 16:

/usr/lib/i386-linux-gnu/crti.o

I'm using Lazarus. Where I need to put the file or path?

Done. In project options > Library (-Fl): /usr/lib/i386-linux-gnu/

There is a way to include to whole lazarus instead of each project?
« Last Edit: October 05, 2016, 12:27:39 am by lainz »

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: crtbeginS.o crtendS.o not found warnings
« Reply #5 on: October 05, 2016, 12:32:01 am »
Assuming you are compiling natively, simply add the path.

Assuming you are cross-compiling then i created a bit of a predicament there for myself :)

My initial thought there was something like cross-compiling from windows to linux but it is of course also perfectly ok to cross compile on linux from 32 to 64bit (or vise verse).

In case the latter, simply add the path again (assuming you have the development libs installed correctly). in case the former you can place them everywhere you would like.

In fact you can place all these files wherever you'd like them to be as long as the paths can be found with Free Pascal/Lazarus. Simply do not mess up existing development installations (usually created by gcc or develop package installations).

For instance for cross-compiling from windows with fpc i've created extra additional (SDK) directories inside fpc/bin directory based on target platform/processor.

PS: A bit more information from your side would be welcome as it ain't exact science there and depends on host/target.
« Last Edit: October 05, 2016, 12:36:48 am by molly »

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: crtbeginS.o crtendS.o not found warnings
« Reply #6 on: October 05, 2016, 12:50:02 am »
Ah, i see you've found it and adjusted your answer accordingly  :)

There is a way to include to whole lazarus instead of each project?
Well, usually this is for a specific target only so a platform specific macro define comes to mind but perhaps some-one knows of a better way ?

I'm not so proficient with lazarus in that regards. (fpc.cfg is easy in that regards  :D )
« Last Edit: October 05, 2016, 12:52:06 am by molly »

cpicanco

  • Hero Member
  • *****
  • Posts: 618
  • Behavioral Scientist and Programmer
    • Portfolio
Re: crtbeginS.o crtendS.o not found warnings
« Reply #7 on: October 11, 2016, 11:04:39 pm »
The most recent Bunsen Labs distro is made on top of Debian 8. Installing the glibc-source solved the warnings. Including the library path (-fi) /usr/lib/gcc/x86_64-linux-gnu/4.9/ solved the warnings!
« Last Edit: October 12, 2016, 05:31:08 am by cpicanco »
Be mindful and excellent with each other.
https://github.com/cpicanco/

munair

  • Hero Member
  • *****
  • Posts: 798
  • compiler developer @SharpBASIC
    • SharpBASIC
Re: [SOLVED] crtbeginS.o crtendS.o not found warnings
« Reply #8 on: January 22, 2020, 09:39:29 am »
Update: Lazarus 2.0.6 on Manjaro 18 also/still seems to be affected. I solved this by replacing the library path for -Fl.

Installation value: /usr/lib/gcc/i586-suse-linux/6/
Should be: /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/

I vaguely remember solving this problem by changing the version to 9.2.0 in a config file.
keep it simple

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: [SOLVED] crtbeginS.o crtendS.o not found warnings
« Reply #9 on: January 22, 2020, 09:47:31 am »
It's documented in the Lazarus FAQ.

Bart

Thaddy

  • Hero Member
  • *****
  • Posts: 14204
  • Probably until I exterminate Putin.
Re: [SOLVED] crtbeginS.o crtendS.o not found warnings
« Reply #10 on: January 22, 2020, 09:54:45 am »
It's documented in the Lazarus FAQ.

Bart
Then it is wrongly documented.

It boils down to finding the library path of the most currently installed GNU libraries.
That is the only way to determine the path on any distribution.

The -Fl part is correct.

whereis is your friend here.
« Last Edit: January 22, 2020, 09:56:23 am by Thaddy »
Specialize a type, not a var.

munair

  • Hero Member
  • *****
  • Posts: 798
  • compiler developer @SharpBASIC
    • SharpBASIC
Re: [SOLVED] crtbeginS.o crtendS.o not found warnings
« Reply #11 on: January 22, 2020, 11:33:18 am »
In /etc/fpc.cfg the path to the gcclib is still set to 8.3.0:

# path to the gcclib
#ifdef cpui386
-Fl/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/32
#endif
#ifdef cpux86_64
-Fl/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0
#endif

Changing it to the current version (9.2.0) solves the problem permanently (no need to change -Fl path for every project).
keep it simple

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: [SOLVED] crtbeginS.o crtendS.o not found warnings
« Reply #12 on: January 22, 2020, 02:51:29 pm »
It's documented in the Lazarus FAQ.
Then it is wrongly documented.

Well then, by all means correct it.
The way it is described now is the way it was recommende to me and how I found it using google...

Bart

munair

  • Hero Member
  • *****
  • Posts: 798
  • compiler developer @SharpBASIC
    • SharpBASIC
Re: [SOLVED] crtbeginS.o crtendS.o not found warnings
« Reply #13 on: September 07, 2020, 12:32:33 pm »
Rolling release distro's are likely to generate this error frequently. Lazarus has updated the library path to 9.2.0 in fpc.cfg, but at least Manjaro is currently at 10.2.0.
keep it simple

 

TinyPortal © 2005-2018