Anyway, my fiddling with compiler versions had created a hernia on my Win32 box, so I binned it all and went looking for a clean GCC build. I got lost in the wilds of SourceForge for some considerable time, but finally hit on this page:
https://sourceforge.net/projects/mingw-w64/files
This guy (and I believe I've come across his work before, on the Mersenne forum) has done a fantastic job, creating stand-alone GCC/G++ compilers that simply work without fuss, without installers, these are as close to "painless installation" as I've ever seen.
Not only that, he has been building these for most major versions of GCC - the latest is 8.2, his builds go back to 4.8 and beyond.
But wait, there's more! He makes builds for Win32, Win64, and some that run on Win64 but can optionally compile/link in Win32 mode!
The procedure to install GCC from these builds is:
- goto the link, scroll down to the appropriate Toolchain area (Win32, Win64, dual target) and follow the chain down to a specific binaries package (this will be a 7Z file)
- download the package, unzip it into some folder. You should now have a "somefolder\mingw32" folder (with subdirectories "bin", "include" etc), which you can now move/rename to some central location, eg C:\GCC or C:\MinGW).
- edit your system-wide PATH environment variable to include a reference to that final location's "bin" folder (eg "C:\MinGW\bin")
That's it, you should be able to enter "gcc --version" in a CMD.exe window and confirm your installation was correct, and away you go.