www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - lld-link should tolerate foo.o

reply V V Kozlov <vvkozlov gmx.de> writes:
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)
Jan 10 2019
parent reply kinke <noone nowhere.com> writes:
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.
Jan 10 2019
parent kinke <noone nowhere.com> writes:
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).
Jan 10 2019