How to add SDL2 in Visual studio code!! Fix all errors!!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello and today uh we're gonna download sdl and then configure it to our Visual Studio code program uh and to do that we have to download STL first so let's go and search for sdl GitHub release on our browser after we do that we're gonna hit enter and then go to our first recommendation after we hit that we're gonna scroll a little bit down and then uh we're gonna download the target set or zip file one of them and then after we do that we're gonna click download for downloading uh after you download it you're just gonna go to the desktop right click click uh go to new folder and then create a folder called sdl projects uh it's we're going to create this folder for our project and then we're gonna open it with our Visual Studio code like this right clicking it and opening it is called or go ahead and open the program and file uh open folder and then go to your desktop select your STL project folder and then hit select folder and then now you're going to create the new main CPP file uh which we're gonna write our code in and then include our iOS stream uh then so we include that we're going to use the namespace standard and then we're gonna check if it's working by printing out hello [Music] let's go hello and then Indo [Music] and let's run it now go to after saving it go to our terminal and then we're gonna say G plus plus past main.cpp hit enter and then now it's running so dot slash a hello that's it it's working so uh so now we're gonna add our our include Library no hour include folder from our sdl here's a new version of sdl that we downloaded earlier let's go ahead and extract it after we extract it click it open it and then go for the 32-bit it's this one and then open the include folder and stl2 and then select everything and we're gonna create an include folder here's two and then select everything here copy and paste it we'll paste it there and after doing that we're gonna also add our library folder on our project here and turn off it we do that go ahead and open your library folder here it is select everything enter copy and paste it there and after doing that we're gonna include the the stl.h header file type include and the apostrophes include slash sdl.h and save it and then after we do that we're gonna configure our library down here at the terminal at the time now [Music] write two plus plus space hyphen L hyphen L for for telling the computer that this is our library pass I'll address hyphen detail and lip is a library folder so let's go ahead and write that and then after we do that hit space and then now we're gonna write our main.cpp file because that's what we're gonna run what what we're gonna build right main.cpp and then after this we're gonna hit space and then drag our library name it's hyphen small L London stl2 hit enter and then after doing that uh we're actually right but here down uh it says undefined reference to win main at 60 so to fix that we're gonna go down here and say undefined Main and save and then and do that again [Music] after doing that it works fine let's run it hello that's it is working very perfectly and now also if you want to check that STL is working you can configure some configure some variables here it's sdo Adventurer we're going to configure a renderer after doing that let's save it and then go down here and build it again it's working dot slash a it's working so everything is working fine and now if you also want to name your program you can write G plus plus uh and then hyphen L capital L leap and then slash o That's the prefix for your uh for your program name and let's name it our program and then space our file that we're gonna run main.cpp and then space slash lsdl to that's the name of our library now we see here our program ex is here so let's write our program EXE and then after we do that hit enter and now you see everything is working and that's it for this video I hope it helped you and if you liked it hit like And subscribe thank you for watching [Music]
Info
Channel: Afisn Drivs
Views: 7,449
Rating: undefined out of 5
Keywords: c++, ide, visual studio code, sdl, visual studio code and sdl, how to configure sdl to visual studio code, visual studio code fix errors, fix errors, fix errors from sdl, sdl error fix, win main 16 error fix
Id: uv4fda8Z8Tk
Channel Id: undefined
Length: 7min 10sec (430 seconds)
Published: Wed Aug 09 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.