While trying to build something with Visual C++ 2015 Community edition I got this fun error while trying to link:
LNK2019 unresolved external symbol __imp____iob_func referenced in function _ShowError
LNK2019 unresolved external symbol __imp__fprintf referenced in function _ShowError
So it turns out that some of the fundamental streams have changed, and when the SDL library is compiled it attaches LIBC into it, which then creates this fun mis-match. The fix is easy, of course, just download the source to SDL 1.25, and re-build it with Visual Studio 2015. But then you’ll get another error that /ZI and /Gy- are incompatible with eachother. I just changed /ZI to the older /Z7 setting, and I could quickly compile SDL, copy the libs to my project and happily link & run.
Yes but the errors get more confusing and then multiply with their paid-for version.
What were you building this time?
I told it to stop after a few errors otherwise it’ll go on and on and on…
I wanted to re-build some old MS-DOS stuff with MinGW, but using a new VC which has a nice debugger and profiler built in!
Thanks. I was revisiting some old code that I wanted to compile with later versions of Visual Studio (2015 and later) and ran into this problem like you did. Thanks for the solution as I was going in circles and Google wasn’t very helpful.
Indeed I have had a few times where I just knew that if I didn’t write it down, years would pass and I’d run into this problem again, and then spend even more time trying to figure it out. I’m always glad when small snippets like this can help others as well but the site grew out of my notes on how to get things done, or weird errors and what to do.