I had similar issue and spent a loooot of time to fix it and the answer was not found I was able to figure that out by myself.
The issue was related to usage of MinGW inside CodeBlocks folder when compiling project and for compiling wxWidgets I was used MinGW that was installed separately.
Hope that at least it will help someone with similar issue.
Also it is possible that newer/older version of MinGW is incompatible.
Mixing different C++ Compilers in C++ projects tend to fail most of the time; wxWidget is an C++ library.
For reason, research C++ name mangling and C++ ABI Application Binary Interface.
Tim S.