SDL with Visual Studio Community 2015

I have been trying to set up SDL2 to work with VS Community 2015 for the last two days. I have been trying to execute this basic code:

#include "SDL.h"

int main(int argc, char* argv[])
{


return 0;
}

But I keep getting the following build errors:
1>------ Build started: Project: Win32Project2, Configuration: Debug Win32 ------
1>MSVCRTD.lib(initializers.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1>SDL2main.lib(SDL_windows_main.obj) : error LNK2019: unresolved external symbol __imp__fprintf referenced in function _ShowError
1>SDL2main.lib(SDL_windows_main.obj) : error LNK2019: unresolved external symbol __imp____iob_func referenced in function _ShowError
1>M:\Programming\Applications\Win32Project2\Debug\Win32Project2.exe : fatal error LNK1120: 2 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


I have properly set the Includes to the SDL Include folder and the Library to the x86 folder respectively. I have also added SDL2.lib & SDL2main.lib to the Additional Dependencies. I have a copy of the SDL2.DLL file in both the System32 and WOW64 Directory. Am I missing something? I linked to DirectX with zero issues... but cannot get SDL to work at all?
It might be that SDL hasn't been updated to work properly with Visual Studio 2015 - have you gone to the SDL forums?

If you just want a usable graphics library in C++, consider SFML - it works with Visual Studio 2015 without issue (I am using it).
Last edited on
I have, the setup tutorial instructions leave off with Visual Studio 2013. I am going to try Code::Blocks and see if works there, otherwise I'm out of ideas.
It looks like someone else ran into your issue:
https://www.gamedev.net/topic/664434-problem-installing-sdl-in-visual-studio-2015/

They suggest rebuilding SDL yourself.
I am going to try to recompile the SDL code as suggested. Code::Blocks was a no go. The only reason I am doing this is because trying to start with DirectX seemed too difficult. SDL seems a tad simpler to get going and see results.
lordnikon428 wrote:
The only reason I am doing this is because trying to start with DirectX seemed too difficult. SDL seems a tad simpler to get going and see results.
As I said earlier, I know for a fact that SFML works in Visual Studio 2015 ;)
Topic archived. No new replies allowed.