Trying to use SDL 2 with Visual Studio c++ -


i trying 1 requires use sdl2 , excited start attempting write program. downloaded sdl2 , didn't have problems.

next opened new empty project followed instructions add include folder, lib(x86) folder, , added sdl2.lib , sdl2main.lib linker.

when tried build project received following error.

1>msvcrtd.lib(cinitexe.obj) : warning lnk4098: defaultlib 'msvcrt.lib' conflicts use of other libs; use /nodefaultlib:library 1>sdl2main.lib(sdl_windows_main.obj) : error lnk2019: unresolved external
symbol _sdl_main referenced in function _main 1>c:\users\nas\documents\visual studio 2013\projects\basic sdl\debug\basic sdl.exe : fatal error lnk1120: 1 unresolved externals

you need link library files.

  1. right click project , properties
  2. click vc++ directories.
  3. click include directories, down arrow, <edit>.
  4. then add directory of include files (where .h files are, example e:\visual studio .net\sdl2-2.0.3\include).
  5. then same library files clicking library directories',down arrow,edit. however, want make sure targeting x86 (for 32 bit program examplee:\visual studio .net\sdl2-2.0.3\lib\x86`) or x64 (64bit program, not common)
  6. then expand linker , click input on left hand side.
  7. click additional dependencies, , edit , add sdl2.lib , sdl2main.lib.
  8. click system under linker heading.
  9. change subsystem /subsystem:console.
  10. finally make sure sdl.dll file in folder of project debug folder.

Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -