Error message when trying to link single D file to produce exe

Cecil Ward cecil at cecilward.com
Sat Jun 10 03:24:51 UTC 2023


I’ve just downloaded ldc and I can successfully generate either 
an object file or asm output file from a single .d source. I’ve 
no idea where to find a suitable linker ( or make ) with which I 
can either link in object files from d- and non-d language 
sources or even just generate an  exe from a single hello world 
.d -> .exe first.

1. I got an error message below.
2. I’ve run ldc on linux before, but osx is new to me. Where do I 
find a suitable linker and what is it called ?

I’m running on osx ventura Aarch64 targeting self, not 
cross-compiling.

Here’s what happened

cecil at Mac-mini ~ %  ./ldc mac_hex_5.d --link-internally
lld: error: must specify -arch
Error: linking with LLD failed
The file "./ldc" is just a tiny one-line bash script that adds 
flags "-O3 -release -mcpu=native" and provides the path to the 
compiler.


More information about the digitalmars-d-ldc mailing list