I'm not really familiar with C::B, when you added the lib did you put the -l prefix on? It's quite possible you need to link to the library differently in C::B than you would from the commandline (e.g. maybe with a fullblown path rather than the -l shorthand stuff). Or maybe it just doesn't know where the lib is (mis)located; there will be a way to add a lib directory if that's the case.
I've checked the linker settings in Code::Blocks and neither of those libraries were present (at least I couldn't see if they were there). I added each one in turn (separately) and the linker reported that neither of the libraries were present on my system.
Can you find libmingw32.a in your mingw install? I believe this is a library you need to link with and to do so ahead of your custom lib containing WinMain.
My current hypothesis is this:
Your WinMain is in a separate lib, while the MS compiler is fine with that GCC is not because it will not link unused symbols and WinMain is, at that point, unused. The fix is to link with mingw32, a teeny(?) library that just has a regular main() function that forwards onto your WinMain function. You link it in ahead of your custom lib which therefore causes the linker to actually use your WinMain rather than ignore it.