Search code examples
mingwwxwidgetsldmingw32

Error collect2: cannot find 'ld' while building wxWidgets


So I was trying to build wxWidgets in release mode using GCC Mingw and following this guide, so I ran the following command: mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=release and it was going all smooth for about 10 minutes when it suddenly threw this error: collect2: cannot find 'ld' mingw32-make: *** [..\..\lib\gcc_dll\wxbase30u_gcc_custom.dll] Error 1

The compiler is working and I've tested it by running some code in codeblocks. I've also tried building the source files through visual studio but it kept throwing a bunch of errors saying it can't open some include files like "commctrl.h", which "I guess" happened due to library build order issues.

So my question is what causes the collect2: cannot find 'ld' and how to fix it?


Solution

  • Updated MinGW and all went good, make sure the path values of MinGW are updated if you install the new version in a different directory.