SDL2/C++ Tutorial. Setting Up SDL & Creating Your First Window Visual Studio 2017

Let's Make Games · 810K views · 2017 · 10:13

Open on YouTube

Game programming & enginesC, C++, Rust, Go & systems languagestutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it because it is the setup guide many beginners follow for SDL2 in Visual Studio, and their questions about linker errors, missing DLLs and blank windows usually trace back to following it.

Recommended by 1 people across 1 different months, 2019 to 2022.

What it is

A 10-minute Windows tutorial from the Let's Make Games channel showing how to download SDL2, configure include and library paths in Visual Studio 2017, and open a first window in C++. It is the first step in a beginner SDL2 game-programming series.

What people said

Recommends LordPotato · 2019-07 · Stack Overflow · on “main already defined in main.obj”

So I ended up deleting SDL and completely restarting with a different tutorial linked here: [this video] Not really sure what the difference was but it worked. Anyways, thanks for your help and I'll put the new code here. #include "SDL.h" int main(int argc, char* argv[]) { SDL_Init(SDL_INIT_EVERYTHING); SDL_Window* window = SDL_CreateWindow("yee haw", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 600, 400, SDL_WINDOW_SHOWN); SDL_Renderer* renderer = SDL_CreateRenderer(window, -1, 0); SDL_SetRenderDrawColor(renderer, 0, 255, 0, 255); SDL_RenderClear(renderer); SDL_RenderPresent(renderer); SDL_Delay(3000); return 0; }

Cites Tomato3 · 2019-10 · Stack Overflow · on “Application error despite console displaying no errors?”

I’ve been watching this tutorial [this video] and I’ve run into an error. For some reason even though I fixed the unresolved external symbols errors, the application error is still available. [LINK] I don't know whether it's due to my computer because it says it's a 64 bit processing system, but nothing seems to work. I tried using one tutorial [LINK] in that I extract the sdl2.dll file then copy pasting it into the windows32 file, and that still didn't work, and the properties panels don't have a compatibility tab on my computer. I'm not sure what to try next. Here's the code #include "SDL.h" #include <stdio.h> int main(int argc, char *argv[]) { SDL_Init(SDL_INIT_EVERYTHING); SDL_Window *window

Cites user13210272 · 2020-04 · Stack Overflow · on “My code has no errors, but it isn't working”

I am making a project on Visual Studio Community in C++.All of my code is correct, but when I run it, it does not show me the wanted output, nor does it show the console.The output should be a green screen on the console, but instead doesn't even show the console. I am a beginning C++ programmer, so I decided to come here and wait if somebody could answer. I would really appreciate it. Thank you. Here is a screenshot link of Visual Studio Community and my code: And here is the link of the youtube video I was following: [this video]

Cites RevivingSociety · 2020-08 · Stack Overflow · on “Why is Visual Studio trying to load SDL2 from Team Fortress 2?”

I was trying to learn SDL2 and C++ and I was following this tutorial [this video] on setting everything up, I copied the code and downloaded the necessary files and moved them, however, when I try to run the code this is what shows in the output '1stSDLWindow.exe' (Win32): Loaded 'C:\Users\Alec\source\repos\1stSDLWindow\x64\Debug\1stSDLWindow.exe'. Symbols loaded. '1stSDLWindow.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. '1stSDLWindow.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. '1stSDLWindow.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. '1stSDLWindow.exe' (Win32): Loaded 'C:\Windows\System32\shell32.dll'. '1stSDLWindow.exe' (Win32): Loaded 'C:\Windows\System32\

Cites Heinrich Reinhard Arbeit · 2022-03 · Stack Overflow · on “How to setup SDL2/SDL.h in visual studio?”

I tried to setup SDL 2 in visual studio following similar instruction to tutorial [this video] and the result was that visual studio was recognizing SDL.h but it was not recognizing SDL2/SDL.h and the include folder of sld2 development tools (link) [LINK] does not have any SDL2/SDL.h file. How to setup SDL2/SDL.h in visual studio ?