A good few months ago, I decided to upgrade my MinGW installation to the latest version, as I noticed that it was now using GCC 4. This caused me a lot of problems as BeebAsm would no longer build, and eventually I gave up, and started to use Visual C++ 2010 Express to build it (which works fine!).
Now, today, out of curiosity, I decided to try again. The latest version of MinGW is using GCC 4.5.2, and I was pleased to see that (after correcting a few missing header includes in the source code) BeebAsm compiles and links fine. The problem is that it doesn't run - instead it bombs out instantly with:
BeebAsm wrote:
This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.
Now, the most striking difference between GCC 4 and older versions is that the C/C++ runtime code has been moved into a DLL, when before it was statically linked. I have a feeling that this crash is probably due to it not dynamically linking with the runtime, but I can't really be sure. The DLL I assume it needs is accessible from the Windows PATH (although I even tried moving it into the same directory as the executable, with no success).
Various sources out there in interwebland suggest linking the project with the switches -static-libstdc++ and -static-libgcc, but these don't appear to be supported by the GCC 4.5.2 port in MinGW. So basically, I'm stuck on this one.
Has anyone used GCC 4 in MinGW with any success? Does any of this sound familiar? I haven't used MinGW for a while now (and this is largely the reason why), but it's a shame, as I always liked the fact that it was available on pretty much every platform, and felt like a good way to compile cross-platform code.