(pls excuse bumping old thread again, but this matches close to a current issue)
Another option that always works is to simply compile SFML yourself, using your chosen compiler. Then it's guaranteed to be compatible with the executables you produce.
This totally makes sense, and it is why I downloaded source, configured cmake-gui to create a CodeBlocks project for SFML locally, and built "all" with all configurations I use (dynamic and static, debug and release).
After completing SFML build results, and moving the appropriate .dlls and .a files for use with my CodeBlocks project, I got the linker error described above - related to
libsfml-graphics-s.a(Sprite.cpp.obj):Sprite.cpp
So, thinking perhaps I'm working with the wrong compiler (MinGW as CodeBlocks 20.03 provides, instead of mingw32, as I had been using previously with CodeBlocks 17.02). After rebuilding SFML using the compiler directory CodeBlocks provides (MinGW - I see both SJLJ and DW2 there), and replacing the .a and .dlls, I got the same linker error.
Doing a bit more reading into this error, it seems just a .dll mismatch, but if I just built it, as Jesper says, shouldn't this just work? CodeBlocks does have settings to point to the correct compiler, and for 'auto-detecting' it. It does auto-configure to CodeBlocks' MinGW.
What would be a good next step here? This setup seemed a little more touchy, less smooth, with the new version of CodeBlocks install. (that's where the linking issues began)
Ideas?
(linker error results, pls excuse relative path to 32-bit install within CodeBlocks)
||=== Build: Release in AwesomeSecretProjectName (compiler: GNU GCC Compiler) ===|
..\..\..\..\..\..\Program Files (x86)\CodeBlocks\SFML-2.5.1\lib\libsfml-graphics-s.a(Sprite.cpp.obj):Sprite.cpp|| undefined reference to `_Unwind_Resume'|
..\..\..\..\..\..\Program Files (x86)\CodeBlocks\SFML-2.5.1\lib\libsfml-graphics-s.a(Sprite.cpp.obj):Sprite.cpp|| undefined reference to `_Unwind_Resume'|
..\..\..\..\..\..\Program Files (x86)\CodeBlocks\SFML-2.5.1\lib\libsfml-graphics-s.a(Sprite.cpp.obj):Sprite.cpp|| undefined reference to `_Unwind_Resume'|
||error: ld returned 1 exit status|
||=== Build failed: 4 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|