Using ld to link with .dll files on Windows

Viewed 1109

I used to be able to use gcc's ld linker by itself, like this:

ld -e main -o hello.exe hello.obj c:\windows\system32\msvcrt.dll

This is for 64 bits.

But I've found that new versions of ld.exe provided with my gcc (mingw/tdm version) just ignore any .dll files that are provided. They would prefer library files (eg. via -lmsvcrt in this case).

Has this ability to use .dll files directly been removed, or are there any new options I need?

(I need an independent linker to link the object files produced by Nasm. I don't want to rely on a bunch of library files that are part of a compiler.)

Otherwise, are there are other linkers I can use? (I know that golink is one, but I need a spare to recommend to others.)

0 Answers
Related