Thread overview
lld-link should tolerate foo.o
Jan 10, 2019
V V Kozlov
Jan 10, 2019
kinke
Jan 10, 2019
kinke
January 10, 2019
When attempting to use Code::Blocks with LDC in Windows, the compile step works OK

ldc2.exe  -g    -I"C:\Program Files\LDC\ldc2-1.13.0-windows-x64\bin" -c hello.d -of=obj\Debug\hello.o

But the linker apparently expects an .obj file

ldc2.exe  -of=bin\Debug\test.exe obj\Debug\hello.o
Error: unrecognized file extension o

Shouldn't this tolerate .o files?  (Clang does)


January 10, 2019
On Thursday, 10 January 2019 at 10:46:27 UTC, V V Kozlov wrote:
> But the linker apparently expects an .obj file

It's not the linker, it's LDC trying to figure out the file type based on its extension (.d, .di, .a/.so/.dylib/.lib, .o/.obj, ...).

> Shouldn't this tolerate .o files?  (Clang does)

I don't think so.
January 10, 2019
On Thursday, 10 January 2019 at 11:58:48 UTC, kinke wrote:
> On Thursday, 10 January 2019 at 10:46:27 UTC, V V Kozlov wrote:
>> Shouldn't this tolerate .o files?  (Clang does)
>
> I don't think so.

I checked; both MS link.exe and lld-link support *.o just fine. LDC's supported file extensions depend on the target (e.g., it rejects .o for Windows targets and .obj for non-Windows ones).