Advertisement
Combreal

SDL2-Setup

Mar 5th, 2022
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. SDL2 SETUP
  2. Download source & compile SDL2/SDL2image
  3. https://libsdl.org/download-2.0.php
  4. https://www.libsdl.org/projects/SDL_image/
  5. Open C:\Temp\SDL2-2.0.20\VisualC\SDL\SDL.vcxproj
  6. C/C++ / Code Generation / Runtime Library : MT
  7. General / Configuration Type : Static Library
  8. Repeat for SDL2image but also add SDL2/SDL2main includes in C:\Temp\SDL2_image-2.0.5\VisualC\external\include
  9. (potentially needs to include C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt)
  10.  
  11.  
  12. Create a test program and link the libraries:
  13. //#include <iostream>
  14. #pragma comment(lib, "advapi32")
  15. #include <SDL.h>
  16.  
  17. int main(int argc, char **argv) {
  18. if (SDL_Init(SDL_INIT_EVERYTHING) != 0) {
  19. //std::cout << "SDL_Init Error: " << SDL_GetError() << std::endl;
  20. return 1;
  21. }
  22. SDL_Quit();
  23.  
  24. return 0;
  25. }
  26.  
  27. C/C++ / Code Generation / Runtime Library : MT
  28. VC++ Directories / Include Directories : $(VC_IncludePath);$(WindowsSDK_IncludePath);C:\Temp\SDL2_image-2.0.5\VisualC\external\include
  29. Linker / General / Additional Library Directories : C:\Temp\SDL2-2.0.20\VisualC\Win32\Release;%(AdditionalLibraryDirectories)
  30. Linker / Input / Additional Depoendencies : SDL2main.lib;SDL2.lib;winmm.lib;version.lib;Imm32.lib;Setupapi.lib;libcmt.lib;libucrtd.lib;user32.lib;gdi32.lib;shell32.lib;ole32.lib;oleaut32.lib
  31. Linker / Input / Ignore Specific Default Libraries : msvcrtd.lib
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement