Can anyone help?
Yes! But damn it was a nasty one.
The fundamental reason is that RTL already has a unit named "dl" in rtl/unix/dl.pp.
Just rename your unit to "mydl" or whatever and it starts to work. After renaming you can test by adding "dl" again to uses section. Ctrl-Click it and see where it jumps.
Some notes, although these don't cause errors:
Reference to "sdflaz" is not needed in project .lpr file.
Package "FCL" dependency is not needed, it comes through LCL.
Also the package "sdflaz" is not needed as a project dependency because it is installed in IDE.Normally an installed design-run-time-packages dependency is needed but now all used units are from FPC libs.
[Edit] I looked at your commit history. "dl.pas" was added with commit message :
"removed CodeTyphon specific components"
although it looks like a refactoring change where code was moved out of main unit into 2 new units.
A question comes to mind: why was the error message so misleading?
It did not say anything about unit "dl" or the units used by "dl".
The problem was especially difficult to find because clean build (Shift-F9) apparently did not clean everything. I commented out units, also "dl" but the same error still came. By luck I happened to delete the whole project lib folder.
How could such errors be found easier?
Anyway, in this case the name "dl" was a bad choice because UNIX systems have libdl.