Error compiling OpenCV with MinGW (and Qt)

Error compiling OpenCV with MinGW (and Qt)

Hello. I'm trying to compile OpenCV win32 DLLs for use by a Qt application. I
figured the best way to go about doing so was to use the MinGW compiler
provided by the Qt SDK. Compilation was successful up to about 70% in, when
I started getting these linker errors:

I've read elsewhere that this has to do with the version of the GCC compiler
being used to make the DLLs -- specifically that the newer versions of GCC
after 4.x don't compile properly. The thing is, I don't know which version
does work. Should I try downgrading my install of GCC? Or is there another
way to deal with this?