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

  Рет қаралды 11,401

Afisn Drivs

Afisn Drivs

Жыл бұрын

Please Subscribe!!!!!!!!!!!!!!!!!!!Please Like!!!!!!!!!!!!!!!!!!!
SDL download link: github.com/libsdl-org/SDL/rel...
Winrar link: www.win-rar.com/download.html...
Copy these links to download the important files needed for your work.
I hope these video will help you fix the errors!
Like and Subscribe if it helped you!!
Thanks for watching!!!

Пікірлер: 73
@tedstosterone1187
@tedstosterone1187 6 ай бұрын
what the fuuuuuuck man ive watched 500 videos banging my head against the wall not understanding why this shit aint working and you stroll right in here and make a simple, clear and WORKING tutorial?! THANK YOU MAN WOW. I was about to break something...
@afisndrivs4647
@afisndrivs4647 6 ай бұрын
wow thats insane
@535_anshuj9
@535_anshuj9 8 ай бұрын
My man, after watching every single video on youtube explaining how to setup sdl in pc and failing, i never expected a video from a channel that has like 40 subs would fix my issue. This video wasnt even in the top 20 in my search results. Thanks man, youre a lifesaver. Subbed.
@afisndrivs4647
@afisndrivs4647 8 ай бұрын
Thanks that helps....
@denverschutz2584
@denverschutz2584 5 ай бұрын
You are the man. Thanks for making a tutorial that is up-to-date!
@C0MP1
@C0MP1 11 ай бұрын
Only SDL2 video that worked for me. Thank you!
@afisndrivs4647
@afisndrivs4647 9 ай бұрын
Glad it helped!
@mivi170
@mivi170 8 ай бұрын
I was so dessesperate beacause I wanted to make a videogame as a final proyect this semester but no library worked until I found this video LOVE YOU
@domanzana
@domanzana 8 ай бұрын
Thanks man! You made possible to port my game to windows! :)
@tacolucky8843
@tacolucky8843 2 ай бұрын
At long last, a guide that is simple and just works. Thank you man, you saved me
@ilannthourault4110
@ilannthourault4110 3 ай бұрын
Bro tysm, after 3hours of searching a good tutorial, i finally found the solution to solve the undefined Winmain@16, u are the only one who did "undef main", it solved my problem thank you !
@kickbaktube
@kickbaktube 2 ай бұрын
You're a Legend. Only tutorial that worked for me. Thank You
@joshuaasuru4686
@joshuaasuru4686 2 ай бұрын
THANKYOU GOD finally a video that workksssssssss
@zulan7880
@zulan7880 5 ай бұрын
thank you!
@Fallout3131
@Fallout3131 5 ай бұрын
Thank you!
@TheTutorialescx
@TheTutorialescx 22 күн бұрын
Bro muchas gracias estuve batallando para instalar SDL, con tu explicación en ingles, fue muy sencilla resolver el problema #undef main y incluir la lib
@afisndrivs4647
@afisndrivs4647 4 күн бұрын
De nada mi hermano
@owenpenning1597
@owenpenning1597 8 ай бұрын
Thank you, Your video was the only one that worked!
@rutujraut3547
@rutujraut3547 5 ай бұрын
Thankyou
@ninjairaq8492
@ninjairaq8492 9 ай бұрын
Question brother? Do I have to add these files every time I create a new project? If only I could add them once
@afisndrivs4647
@afisndrivs4647 9 ай бұрын
I chose that way cause it's the easiest. If you don't add the files there, you have to write the full path of the files(C:\users\MYPCNAME\downloads\SDL2\it continues) which is in your downloads folder. Choose whatever way you want it will work for you.
@RuakUwU
@RuakUwU 8 ай бұрын
Hi dude this tutorial is great. But i've a question, I wanna check if SDL is installed in vscode so I Type sdl2-config --version in the terminal and it show a error message. It that mean I haven't installed SDL?
@afisndrivs4647
@afisndrivs4647 8 ай бұрын
if ur code works fine u have installed it u dont need to check it
@beardy_player
@beardy_player 8 ай бұрын
im getting an error called SDL.h no such file or directory
@afisndrivs4647
@afisndrivs4647 8 ай бұрын
can you show me your code
@sreepriyacp5768
@sreepriyacp5768 Ай бұрын
Same issue
@meghaantony7896
@meghaantony7896 9 күн бұрын
main.cpp:2:21: fatal error: inc/SDL.h: No such file or directory this error is showing in the terminal
@afisndrivs4647
@afisndrivs4647 4 күн бұрын
It is because you don't have the SDL.h file in your folder. Check that the file is in there again.
@nicholasgalea4680
@nicholasgalea4680 5 ай бұрын
when following the instructions for the terminal and entering ./a (such as you did in 2:30), i am having this error: zsh: no such file or directory: ./a Can you help me please?
@afisndrivs4647
@afisndrivs4647 5 ай бұрын
Maybe its because you didn't install g++ correctly. Check it by freshly installing it. There are guides on youtube for that. Check them out!
@InsaneParrot
@InsaneParrot Ай бұрын
doesn't work. it says that it can't find -lSDL2
@afisndrivs4647
@afisndrivs4647 Ай бұрын
im sure it'll work just try it correctly check if what u typed is correct
@viralit8685
@viralit8685 3 күн бұрын
Unidentified reference to winmain@16 ? Whaaaat
@afisndrivs4647
@afisndrivs4647 3 күн бұрын
Did you finish the video? I have a fix for that too.
@nhanhuynh6563
@nhanhuynh6563 8 ай бұрын
I did the same as you but I can't install it, it keeps saying it can't find the library, can you show me how?
@afisndrivs4647
@afisndrivs4647 8 ай бұрын
can u send me what you have written(copy it and send it here)
@Myprecious2k4
@Myprecious2k4 8 ай бұрын
Question bro! Video can do with SDL 1 ?
@afisndrivs4647
@afisndrivs4647 8 ай бұрын
im not sure...
@user-dj4uz2mh9q
@user-dj4uz2mh9q 5 ай бұрын
when I do step 5:23 it said that could not find -lSDL2 :( can you help me
@afisndrivs4647
@afisndrivs4647 5 ай бұрын
are u sure u copied all of the files correctly?
@notsneazy2462
@notsneazy2462 4 ай бұрын
good video bro but when i do "g++" it gives me a error. The terminal says that the term g++ is not recognized as a operable program. pls help
@afisndrivs4647
@afisndrivs4647 4 ай бұрын
Well, that's a problem that happens when you don't install g++ correctly. So do a fresh install of g++ again. There are many videos that guide you to do that. Check it out!
@techniquemedia178
@techniquemedia178 Ай бұрын
Man your videos are great. I just subbed. Can you fix this error? in the inc file, I included everything. In the lib file, I included everything. In the main function, I wrote this code: #include #include "inc/SDL.h" using namespace std; int main(){ cout
@afisndrivs4647
@afisndrivs4647 Ай бұрын
You didn't put space b/n #include and and if this didn't fix your error can you just tell me what the error says at the terminal?
@techniquemedia178
@techniquemedia178 Ай бұрын
@@afisndrivs4647 Man that doesn't fix it either. Please help.
@afisndrivs4647
@afisndrivs4647 Ай бұрын
​@@techniquemedia178 can you send me the error code that pops in the terminal? lemme read and find the issue for you. Sorry for being late
@powered_by_source
@powered_by_source Ай бұрын
main.cpp:2:10: fatal error: SDL.h: No such file or directory 2 | #include | ^~~~~~~ pls help
@afisndrivs4647
@afisndrivs4647 Ай бұрын
Just do what I did. Its not done like that!! Write SDL.h in apostrophes(" ") not in and also you didn't put in a folder
@powered_by_source
@powered_by_source Ай бұрын
@@afisndrivs4647 i followed the tutorial step by step
@user-nq8sx3bm2r
@user-nq8sx3bm2r 10 ай бұрын
i do the same as u do and it returns an error collect2.exe: error: ld returned 1 exit status can u help me to fix this thank you!
@sarijen37
@sarijen37 9 ай бұрын
you didnt watch the whole video (add #undef main to your code)
@benjamindusunceli9461
@benjamindusunceli9461 9 ай бұрын
i did add this line but still have the same error :/@@sarijen37
@afisndrivs4647
@afisndrivs4647 9 ай бұрын
hope that worked for you
@andreargori6758
@andreargori6758 8 ай бұрын
@@afisndrivs4647 hi, i have a problem, with a .C would it work too?
@justvictorgd
@justvictorgd Ай бұрын
@@sarijen37 I have the same problem and adding #undef main does not solve the issue. It's the same "collect2.exe: error: ld returned 1 exit status" error.
@rajiraj1347
@rajiraj1347 5 ай бұрын
Bro code u wrote is not visible
@afisndrivs4647
@afisndrivs4647 5 ай бұрын
which one?
@sanaparween7415
@sanaparween7415 Ай бұрын
Does this work for python
@afisndrivs4647
@afisndrivs4647 Ай бұрын
I'm not sure
@user-nk9sk7hx7o
@user-nk9sk7hx7o 4 ай бұрын
./a not working
@afisndrivs4647
@afisndrivs4647 4 ай бұрын
Check if u did everything perfect and then if it doesn't work install SDL again.
@michaelswahla4927
@michaelswahla4927 5 ай бұрын
u forgot that u needa add sdl2.dll otherwise it dont work
@afisndrivs4647
@afisndrivs4647 5 ай бұрын
did it work for u tho?
@michaelswahla4927
@michaelswahla4927 5 ай бұрын
yea it did@@afisndrivs4647
@michaelswahla4927
@michaelswahla4927 5 ай бұрын
yea it did@@afisndrivs4647
@sreepriyacp5768
@sreepriyacp5768 Ай бұрын
#include #include "inc/SDL.h" #undef main using namespace std; int main() { cout
@afisndrivs4647
@afisndrivs4647 Ай бұрын
Are you sure you have that folder in your project? It is saying that you are missing the SDL.h file or the "inc" folder. You have to add them for it to work.
@anastasiaytkina2223
@anastasiaytkina2223 3 ай бұрын
help please !🙏 ``` #include #include #include "inc/SDL.h" #undef main void main() { SDL_Renderer *rendere; SDL_Window *window = NULL; if (SDL_Init(SDL_INIT_EVERYTHING) != 0) printf("error initializing SDL: %s ", SDL_GetError()); else { window = SDL_CreateWindow("SDL Tutorial", SDL_WINDOWPOS_CENTERED_MASK, SDL_WINDOWPOS_CENTERED_MASK, 640, 480, SDL_WINDOW_SHOWN); if (window == NULL) printf("Window created erroe: %s ", SDL_GetError()); else { SDL_UpdateWindowSurface(window); SDL_Delay(20000); } } SDL_DestroyWindow(window); SDL_Quit(); } ``` PS C:\Users\Анастасия\Desktop\Текстыпрограмм\Пакмен> gcc -Llib main.c -lSDL2 PS C:\Users\Анастасия\Desktop\Текстыпрограмм\Пакмен> ./a PS C:\Users\Анастасия\Desktop\Текстыпрограмм\Пакмен> cd "c:\Users\Анастасия\Desktop\Текстыпрограмм\Пакмен" ; if ($?) { gcc main.c -o main } ; if ($?) { .\main } c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\08DE~1\AppData\Local\Temp\cc5DLJak.o:main.c.text+0x1e): undefined reference to `SDL_Init' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\08DE~1\AppData\Local\Temp\cc5DLJak.o:main.c.text+0x27): undefined reference to `SDL_GetError' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\08DE~1\AppData\Local\Temp\cc5DLJak.o:main.c.text+0x6d): undefined reference to `SDL_CreateWindow' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\08DE~1\AppData\Local\Temp\cc5DLJak.o:main.c.text+0x7d): undefined reference to `SDL_GetError' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\08DE~1\AppData\Local\Temp\cc5DLJak.o:main.c.text+0x9b): undefined reference to `SDL_UpdateWindowSurface' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\08DE~1\AppData\Local\Temp\cc5DLJak.o:main.c.text+0xa7): undefined reference to `SDL_Delay' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\08DE~1\AppData\Local\Temp\cc5DLJak.o:main.c.text+0xb3): undefined reference to `SDL_DestroyWindow' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\08DE~1\AppData\Local\Temp\cc5DLJak.o:main.c.text+0xb8): undefined reference to `SDL_Quit' collect2.exe: error: ld returned 1 exit status
@afisndrivs4647
@afisndrivs4647 3 ай бұрын
i am not sure abt this
Why do we use SDL with C & C++?
16:26
pikuma
Рет қаралды 42 М.
Getting Started with SDL2 and C++ in Visual Studio
30:59
Kyle Geske
Рет қаралды 262
ОБЯЗАТЕЛЬНО СОВЕРШАЙТЕ ДОБРО!❤❤❤
00:45
Zed - The 'Visual Studio Code Killer' - Now on Linux!
5:14
Gamefromscratch
Рет қаралды 57 М.
12 VS Code Extensions to INCREASE Productivity 2024
27:13
Devression
Рет қаралды 620 М.
How to add SDL2 in Eclipse!! Fix all errors!!
4:43
Afisn Drivs
Рет қаралды 319
How to Setup SDL2 and VSCode to Start Programming OpenGL on a Mac
21:41
Independent Pixels
Рет қаралды 22 М.
Simple SDL2 Setup in directory (MinGW, VS Code, Windows)
4:25
HerbGlitch
Рет қаралды 67 М.
How to setup VS Code to run OpenGL code (Shorter Version)
9:19
A C++ Enjoyer
Рет қаралды 14 М.
Learning SDL2 in 48 Hours - GMTK Game Jam 2020
9:19
PolyMars
Рет қаралды 3,1 МЛН
How To Fix Include Errors in C++
9:14
The Cherno
Рет қаралды 83 М.
BEST WAY to make Desktop Applications in C++
26:00
The Cherno
Рет қаралды 900 М.
Setting up SDL2 in Visual Studio 2019 - SDL2 Tutorial
9:07
Playing With Data
Рет қаралды 4,9 М.
Look, this is the 97th generation of the phone?
0:13
Edcers
Рет қаралды 8 МЛН
8 Товаров с Алиэкспресс, о которых ты мог и не знать!
49:47
РасПаковка ДваПаковка
Рет қаралды 178 М.
КРАХ WINDOWS 19 ИЮЛЯ 2024 | ОБЪЯСНЯЕМ
10:04
Looks very comfortable. #leddisplay #ledscreen #ledwall #eagerled
0:19
LED Screen Factory-EagerLED
Рет қаралды 12 МЛН