Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2015-06

Is there some reason why the linker cannot find crti.o, crtn.o etc?

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

vfclists .

These messages come up almost always when I compile a project:

Warning: "crti.o" not found, this will probably cause a linking failure templateSys.lpr(39,1) Warning: "crtn.o" not found, this will probably cause a linking failure.

On a 32bit system the files are located in /usr/lib/i386-gnu and /usr/lib/gcc/i686-linux-gnu

find /usr/lib -type f -name crt*

/usr/lib/i386-linux-gnu/crti.o
/usr/lib/i386-linux-gnu/crtn.o
/usr/lib/gcc/i686-linux-gnu/4.X/crtbegin.o
/usr/lib/gcc/i686-linux-gnu/4.X/crtend.o

I don't know if some of them are debug builds which may have other attributes which make them undetectable by the linker.

Some of the errors may also be related to the gnu tools and not be FPC/Lazarus related.

This issue bit me when I was trying to cross compile some synopse libraries (I have forgotten how I fixed it) and I want to know how it can be fixed permanently in my installations.

Frank Church ======================= http://devblog.brahmancreations.com

Reply by email

Marco van de Voort
to vfclists .

In our previous episode, vfclists . said:

Warning: "crti.o" not found, this will probably cause a linking failure templateSys.lpr(39,1) Warning: "crtn.o" not found, this will probably cause a linking failure.

Under Linux, the directory for those files is passed to FPC by a -Fl line in the fpc.cfg which is setup by the installer script (standalone pkg) or the distribution (in the case of a distribution package)

Usually that installer calls fpcmkcfg which calls gcc with --print-libgcc-file-name to determine the location.

This assumes everything is configured correctly when FPC was installed, if not, try rerunning fpcmkcfg or manually fixing fpc.cfg

Reply by email