SDL 2 Tutorial 1d [SETUP] Windows and CodeBlocks Setup

preview_player
Показать описание
🚀 Get 100% Off Your First Month with CustomGPT! 🚀

Sign up for a Standard CustomGPT.ai subscription using my referral link and enjoy 100% off your first month. Plus, you'll help support my channel with a 15% commission at no extra cost to you!

If you like this stuff, as always, show the love through comments, likes, favorites, subscriptions, etc.

Thousands of free videos at

If you have any questions feel free to post them at

Our Website

Our games made using Cocos2d-x
------------------------------------------------------

Udemy Coupons:
Рекомендации по теме
Комментарии
Автор

Welcome to this SDL tutorial.

If you have any questions feel free to post them on our free education platform sonarlearning.co.uk

SonarSystemsCoUk
Автор

Thanks man great tutorial, straight to the point and still works 4 years later :)

dalkap
Автор

This is the best SDL2 tutorial forever

mrbare
Автор

Thankssss a lot it helped me very very much, I tried it for 3 days once I saw your blog and video I am crystal clear and conpiled without any errors

charansrinivas
Автор

Thanks for the tutorial! It's super useful having a video for tricky setups like this.

This "Cannot find -lSDL2main / -lSDL2" is definitely an issue that loads of people run into. I simply don't believe that it's just people not being careful enough following these tutorials. There's something wrong either with the defaults of CodeBlocks, or the MinGW compiler it installs, or SDL2.

I always run into the exact same issue with the LazyFoo tutorial, as well as this one, and this is on many different machines. Even on completely fresh setups where I'm really, really careful.

diplodocus
Автор

Soon it’s 2024 and this video is still relevant and working❤

habibulloqodirov
Автор

i feel like you should of put the 64 and 32 bit at the start, it really makes things more repetitive as you have to redo everything from the tutorial and make a new project

ch_eah
Автор

TL;DR: Compiler was in 64-bit, not linking 32-bit libraries. Changed to 64-bit libraries and it works.

Like others, I had an issue where it could not find the SDL2main and SDL2 libraries.
I looked in the build logs. It was definitely searching for them, but labeled them incompatible.
Then I realized that's because the compiler is running in 64-bit! I changed the SDL2 files from 32-bit to 64-bit and it works.

kriszenn
Автор

Was having trouble with getting this into codeblocks for awhile but your tutorial finally got it going for me, thanks my dude!

Destructive
Автор

5:50

I spent such a long time trying to diagnose, then raised the video quality to 1080 and noticed I needed to change SDl_2 to SDL2.

Thank you so much for this!

truesoundwave
Автор

Finally a tutorial that made it work. Subscribed. Thank you good sir.

JMtheCONQUERER
Автор

THANK YOU ARE THE ONLY VIDEO in the Internet what help me setup this

JRpln
Автор

Finally, after 12 hours I've finally gotten it installed. Now I can start learning (:

Wave_Duck
Автор

By the way, in case you get bored of WinRAR, 7-Zip is freeware that doesn't have annoying popups and can also extract more!

rayredondo
Автор

Still working, tested it today. Thank you.

tsvetelinadimitrova
Автор

Been looking for a way to use SDL for so long, thanks a million!! Earned my like!

frpheonix
Автор

@Sonar -> not sure if anyone let you know but use std::endl; not std::endl(); its a variable not a function. Also for any of you who are using WinMain rather then Main for your use #define SDL_MAIN_HANDLED to let SDL know your handling winmain.

nyxkeres
Автор

k so after some time struggling to install it (even if it wasn't my first time) I finally got it to work, thanks !


Also, if your problems don't correspond to any of the other comments, you may have :
- gone into the compiler properties or build targets instead of *project - properties - build targets* (note that it is different)
- wrote -lSDL2_main by habit, instead of -lSDL2main (notice the difference, no underscore here)


This also helped me installing SDL2_image and SDL2_ttf.
Note that when you do so, only put the SDL_image.dll (or any other extension) in your project, it's useless to copy all 6 dlls.
I personally created new search directories as in this tutorial instead of putting extentions in the SDL file, as it was recommended in all other sites I've been through.
And also, for extensions you **have** to put an underscore (ex : -SDL2_image) !


Hope this can help you, have a good day !

sho
Автор

Had some issues with the compilation. With the 32 bit version named "i686..." and the 64 bit version named "x86...", this is the opposite of what I expected. Picked up on where you specified which is which. After that all went well. Many thanks!!!

scottmandel
Автор

If you have made everything in video and it doesnt work try putting #define SDL_MAIN_HANDLED before #include <SDL2/SDL.h>

bondziotek