collect2: cannot find `ld'

Previous topic - Next topic


Hi Gernot,

Any idea what's causing this error (I have the latest patch).

There's no indication if it's in my source and as it happens on linking could it be something in GLB?

*** Configuration: WIN32 ***
GPC - GLBasic Precompiler V.2008.179 - 3D, NET
Wordcount:3328 commands


collect2: cannot find `ld'
*** FATAL ERROR - Please post this output in the forum
*** Finished ***
Elapsed: 19.4 sec. Time: 19:36
Build: 0 succeeded.
*** 1 FAILED ***

Kitty Hello

ouch! Is there no file:

There's something seriously wrong. When did it start? Did you install anything else beside GLBasic?


I'd missed a couple of patches and I everything was running ok previously.

Hmmm... I have got that file:

C:\Program Files\GLBasic\Compiler\platform\Win32\Bin\ld.exe

I've recently installed VS2008 but I think that's all.

Kitty Hello

A new install/update didn't help either?



I installed v 5.235 from the CD and all my programs worked.  I then did the internet update to the latest version and nothing will compile.  Did you say you upgraded the GCC compiler recently ... could that be something to do with this?

BTW, it does this with anything I try to compile, even just a simple test program...

SETSCREEN 640,480,0

Kitty Hello

I installed the very new thing on a PC and did the update, and it worked.
Do you have a copy of MinGW on your computer, maybe?
It's very strange.


Ah, it's that MinGW bug again.  If I rename the mingw folder, GLBasic works again. 

Kitty Hello


I <3 DGArray's :D

AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard


Any luck with this one?  Still occurs if MINGW folder is not disabled (renamed).  I'm on Vista BTW.

Kitty Hello

it worked for me. What versinn of mingw do you have?


Ver 5.1.3.

It looks like 5.1.4 is the latest.  Installing ...

Yay... success.  No more ld errors.

Kitty Hello

aces. I can't seem to get that version to try and fix it...


The main thing is that there is a sensible work around, ie: get the latest MinGW.  I don't suppose that will be a problem for most who are still using MinGW 5.1.3 and GLBasic.


I'm having the exact same error message.

collect2: cannot find `ld`

It happens when I try compiling for Linux, or Mac. When I compile for Windows everything works well. I have unzipped the latest Linux and Mac compilers in Compiler/platform/.

I used to have Cygwin installed but that was a long time ago. Never had MinGW installed. ld.exe does exist in the Windows compiler directory.


Can it be a conflict with older GLBasic versions I still have on disk maybe?