Hi guys,

Error-

    collect2.exe:fatal error:cannot find 'ld'
    compilation terminated

Compiler:gcc
library:mingw

I have done quite a bit of internet search and followed a discussion pertaining to this on daniweb,but to no avail.Am working on code blocks. Initially there was no problem, then i linked libws2_32.a and even though it compiled for some time with no problem, but then it started giving me the error collect2: cannot find `ld'.
I have reinstalled codeblocks, ld.bfd.exe is present in mingw, however the problem persists.
I even tried using the ld.exe from another user, but it did not work, it crashes midway.(It was just an attempt and i do understand that since ld.exe was taken from linux so it in any case did not work).

PLease help. I am new to programming on windows,ubuntu was much more comfy.

even g++ on cmd has stopped working(which is understandable). Moreover, it is creating object files, so the problem is in the linker only. Am using mingw library. No code of c++ is now working, atleast no the ones requiring the use of mingw.

Recommended Answers

All 2 Replies

The 'ld' command is the linker for GCC compilers, such as MingW. If you installed Ming in a normal manner, it should be on your system as well. Possibly you deleted it? Or installed MingW in a non-standard manner?

I did install everything correctly, since it was working quite fine at first. However i reinstalled mingw, and it seems to work fine now.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.