Search code examples
c++gccmingw

Why are there two bin folders in Mingw port of gcc builds?


I recently tried to download the latest version of gcc for Windows. When I downloaded the latest version from this link (the dwarf version) : x32-4.8.0-release-posix-dwarf-rev1.7z I noticed there are two bin directories.

1.bin
2.i686-w64-mingw32\bin

What's the difference between these two folders and which one should I introduce to the IDE (e.g CodeBlocks). Why in first place there are two folders already?


Solution

  • This is because of the way GCC/binutils works. The executables in the <target>\bin subdirectory are for internal use by the compiler only. This should never be in PATH.

    The executables in the toplevel bin directory are the ones you need to use, which in turn call the real compilers and may call the executables in the subdirectory.

    I agree it is silly for it to be this way, but I see no way of this being changed in the near or far future.