SDL2 Setup Tutorial - SDL Tutorial Series #1 - Game Dev With C++

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024
  • In this video we will be setting up sdl2 with vscode
    links mentioned:
    sdl2 - libsdl.org/
    sdl_image - www.libsdl.org...
    vscode: code.visualstu...
    twitter:
    main - / scoopydevy
    2nd - / scoopydevy2
    #gamedev #sdl2 #sdl2setup #sdl2_vscode

Комментарии • 286

  • @vaderdev
    @vaderdev  3 года назад +88

    all:
    g++ -Iinclude -Iinclude/sdl -Iinclude/headers -Llib -o Main src/*.cpp -lmingw32 -lSDL2main -lSDL2 -lSDL2_image

    • @m4rt_
      @m4rt_ 2 года назад +5

      on linux use this to get all sdl2 headers
      `pkg-config --cflags --libs sdl2 SLD2_image`
      then the include is
      #include

    • @wakikiboy1230
      @wakikiboy1230 2 года назад +1

      Description nextime

    • @ЖукОбычниик
      @ЖукОбычниик 2 года назад +2

      @@m4rt_ Bro you wrote SLD2_image instead of SDL2_image. How you gonna fuck me up like that I wasted like 30 minutes 💀

    • @m4rt_
      @m4rt_ 2 года назад +1

      @@ЖукОбычниик it was a typo

    • @baiduanti-virus3125
      @baiduanti-virus3125 2 года назад

      Makefile:2: recipe for target 'all' failed
      mingw32-make: *** [all] Error 1
      help please

  • @DJPICKA
    @DJPICKA 3 года назад +60

    dude, I literally spent 3 hours trying to get SDL to work on VS code, already watched like 3 tutorials and none of them worked. This is the only tutorial that shows how to really make it work. Thank you!

    • @vaderdev
      @vaderdev  3 года назад +8

      awww thanks man! More videos to come :)

    • @averagecornenjoyer6348
      @averagecornenjoyer6348 Год назад

      m quite late, but what was it that made it work

    • @simply__kk
      @simply__kk Год назад

      ​@@averagecornenjoyer6348hey can you help me in installing sdl2 in vscode

    • @WhatDoYouWant000
      @WhatDoYouWant000 Год назад

      I got an error while entering the make comand it says make (e=2) the system cannot find the file specified HOW DO I FIX IT @@vaderdev

    • @random-user-s
      @random-user-s 3 месяца назад

      Glad you made it work, but if you use visual studio is actually easier.

  • @shahvaiz3291
    @shahvaiz3291 2 года назад +32

    undefined reference to `WinMain@16'
    If you are getting the above error, define SDL_MAIN HANDLED and include the SDL header file. Copy and paste the two lines mentioned below:
    #define SDL_MAIN_HANDLED
    #include
    Thanks for the tutorial, helped me a alot.

    • @pastifier9349
      @pastifier9349 2 года назад +2

      Thanks a lot! Gonna add your name to the special thanks section in my game's credits when it comes out after 12 years! (if I don't forget LOL)

    • @shahvaiz3291
      @shahvaiz3291 2 года назад +1

      @@pastifier9349 Don't worry.I'll remind you,

    • @abeke5523
      @abeke5523 2 года назад

      thank you!!

    • @abeke5523
      @abeke5523 2 года назад +1

      This fixed the undefined reference to 'WinMain@16' error, but I still had other problems. I copied a basic window creation program using SDL to test if it works, but the compiler threw errors such as "undefined reference to SDL_Init".
      To solve this problem I had to replace the 64-bit SDL files (lib, include folders and .dll files from folder x86_64-w64-mingw32) with 32-bit SDL files (the same files but from folder i686-w64-mingw32). It worked, but I want to make the 64-bit files work, so please help if anyone knows!
      edit: turns out it's quite trivial, I had installed MinGW which can only compile 32-bit programs. I needed MinGW-W64 for 64-bit :p

    • @giorgossofronas6764
      @giorgossofronas6764 2 года назад +1

      Thank you!

  • @CaThellman
    @CaThellman Месяц назад

    OMG you don't know how long I have been trying to get this to work, like all the other tutorials don't explain anything. You did, Thank you so much.

  • @nialyavuzturk379
    @nialyavuzturk379 Месяц назад

    I think this is the first tutorial for installing a framework that I've went through without one single error, thank you so much!

  • @c4rbon_free521
    @c4rbon_free521 2 года назад +9

    Thank you so much! This is the only setup tutorial I followed that actually worked (and the only tutorial in which it is explained so clearly what each step does).. Have a great day!

    • @vaderdev
      @vaderdev  2 года назад +2

      haha thanks! have a gr8 day aswell :)

  • @AOE3DE_QUOTES
    @AOE3DE_QUOTES 2 месяца назад

    Man you're totally legend, after searching enourmous data on the internet I finally got a tutorial that completely shows step by step from install to Makefile with vscode, great job dude.

  • @ProsafiaNguyen
    @ProsafiaNguyen Месяц назад

    This is the only video that I use SDL2 and it works perfectly! Thanks for the vid

  • @foreveryoung9563
    @foreveryoung9563 Год назад +4

    i know u probably will not even see this comment but i really want to thank you for this, it may seem crazy but i think i watched at least 20 tutorials and this is the one that worked, i even switched from codeblocks to vs code for this, have a great day if u read this! and thanks again ♥

  • @ct7204
    @ct7204 Год назад +1

    For those looking for a good SDL2 setup tutorial, THIS IS THE ONE!

  • @graysonbyrd1985
    @graysonbyrd1985 2 года назад +5

    Bro I have been trying to get SDL to download for 4 hours... You are a life saver. Thanks a ton!!

    • @lazzzy5514
      @lazzzy5514 2 года назад

      hey what is the difference between visual and mingw . Why did he used mingw when he used vs studio could you explain i am new

    • @turdsalami
      @turdsalami 2 года назад +2

      @@lazzzy5514 dunno if you still care but but mingw and visual c++ are just compilers on windows. He isn’t using visual studio, the IDE, he’s using vscode which doesn’t pre-install with a default c++ compiler. Unless you use the IDE, most people just use mingw. Personally I prefer gcc though.

    • @turdsalami
      @turdsalami 2 года назад

      @@retrogalaksi honestly I don't remember. It was through some package manager on windows. But mingw is probably better or at least easier to setup. Or use Linux where gcc is there by default.

  • @IDontKnow-qs9nx
    @IDontKnow-qs9nx 3 года назад +1

    Why is it always the one who is helpful is always the most underrated in RUclips

    • @vaderdev
      @vaderdev  3 года назад

      ikr pls do share the video so others can find it to

  • @yahboi7137
    @yahboi7137 3 года назад +4

    thanks for making these videos bro you dont know how much your helping people

    • @vaderdev
      @vaderdev  3 года назад

      thanks man appreciate it :)

  • @HamzaSaleem-e1g
    @HamzaSaleem-e1g 10 месяцев назад

    Oh main you are such a life saver! It took me a day to set up SDL.

  • @chadman4478
    @chadman4478 Год назад

    FINALLY! YES, OH YES! I read the documentation, github readme files, youtube videos and none of them worked, then I as my last hope, i stumbled up on this c++ video and it finally worked, I know im 1 year late but thank you very much. just letting you know I'm grateful for this tutorial. ♥

    • @vaderdev
      @vaderdev  Год назад

      lmao i made this vid for fun didnt know it would help so many peeps

  • @gaydemaupassant6263
    @gaydemaupassant6263 2 года назад +5

    Umm.. There is something I don't understand, the thing is that the dll files added in the file explorer don't seem to exist while looking from VS code, only the include and lib directories are shown 11:20

  • @zetroxgaming1441
    @zetroxgaming1441 23 дня назад +1

    Plz solve my issue
    g++: error: src/*.cpp: Invalid argument
    MakeFile:2: recipe for target 'all' failed
    mingw32-make: *** [all] Error 1

  • @mahdirahmani5046
    @mahdirahmani5046 8 месяцев назад

    best EVER so far. THANKS MAN.
    YOU SAVED MY LIFE....

  • @kito5320
    @kito5320 2 года назад

    After hours of searching how to use SDL2 , it finaly works! TY and have a great day!

  • @IMPULSEOP
    @IMPULSEOP 2 года назад +4

    i keep getting this error help :((( 'mingw32-make' is not recognized as an internal or external command,
    operable program or batch file.

  • @trivial1344
    @trivial1344 Год назад

    Man this took 5 hours but your video helped me, kudos bro

  • @RoyalRabbiz
    @RoyalRabbiz 2 месяца назад

    It works man! I watched more videos on youtube but none of them wrk. But you great teacher❤

  • @sumin1018
    @sumin1018 3 года назад +3

    finally a sane tutorial for setting up sdl2,thanks dude

    • @vaderdev
      @vaderdev  3 года назад

      haha np

    • @lazzzy5514
      @lazzzy5514 2 года назад

      why did you did it with mingw , cant we do it with visual ?
      and can we use mingw as compiler after coding in vs studio sorry i am new i dont have much knowledge about it pls help me out

  • @themirestudios3326
    @themirestudios3326 2 года назад +2

    If you have an error which says lSDL2main and lSDL2 directories could not be found, then go to the normal SDL folder (not the image) that was extracted and copy the stuff from the lib into the lib we have on Vscode. Don't replace since we need the image one too. Had this issue and resolved it this way.

  • @LOsTONthEWAyyY
    @LOsTONthEWAyyY 2 года назад +4

    when i type mingw32-make it says its not recognized but i have mingw added to my path? even when i try to type mingw in the bin folder of mingw it doesnt work

  • @elidoz9522
    @elidoz9522 2 года назад +2

    I have no idea how but it worked, mingw couldn't find the reference to SDL apparently, but after changing literally nothing it started working.
    It must be those damn cosmic rays !

  • @thawzan7370
    @thawzan7370 Год назад +5

    I keep getting this lmao:
    src/Main.cpp:1:17: fatal error: SDL.h: No such file or directory
    #include
    ^
    compilation terminated.
    MakeFile:2: recipe for target 'all' failed
    mingw32-make: *** [all] Error 1
    can i get help with this? Thx

    • @dooperlzwak
      @dooperlzwak 6 месяцев назад

      I just redid the last bit of the tutorial and it worked fine

  • @ProjectMarzDev
    @ProjectMarzDev 4 месяца назад

    thank you so mu8ch all i needed was the image one now i can use them lol thank you!

  • @ZackZ4ckariax
    @ZackZ4ckariax 3 года назад +3

    sir u deserve more than you have thank you so much

  • @OseniMatthew
    @OseniMatthew 5 месяцев назад

    You just saved me with this video. Thanks a lot

  • @ivanalejandroenriquezgrand1993
    @ivanalejandroenriquezgrand1993 2 года назад +2

    Your awesome, dude. This tutorial really works

  • @bell0cado
    @bell0cado Год назад

    the only working non indian tutorial!!! (not hate speech, don't sue me pls)

    • @vaderdev
      @vaderdev  Год назад +1

      jokes on u i am indian

  • @juanfrareggiardo3430
    @juanfrareggiardo3430 2 года назад +4

    if you're like me and everything worked but when compiled an error saying "undefined reference to `WinMain`" pops up, just add before the SDL.h header a define directive with the SDL_MAIN_HANDLED macro, seemed to work for me

    • @abdullahnaseem7518
      @abdullahnaseem7518 2 года назад

      can u explain me how
      getting undefined reference to winmain error

    • @shahvaiz3291
      @shahvaiz3291 2 года назад +2

      #define SDL_MAIN_HANDLED
      #include "SDL.h"
      ADD it to the top
      now my error is fixed

  • @CoolStop2
    @CoolStop2 3 месяца назад

    “Always do everything the easy way, not the hard way.”
    *Uses C++*
    But yeah great tutorial

  • @marquinus2564
    @marquinus2564 Год назад +3

    I get this error :()
    g++ main.cpp -Iinclude -Llib -lmingw32 -lSDL2main -lSDL2 -lSDL2_image -o main
    process_begin: CreateProcess(NULL, g++ main.cpp -Iinclude -Llib -lmingw32 -lSDL2main -lSDL2 -lSDL2_image -o main, ...) failed.
    make (e=2): El sistema no puede encontrar el archivo especificado.
    make: *** [all] Error 2

    • @ozu7779
      @ozu7779 3 месяца назад

      some ;(

  • @range685
    @range685 Год назад +2

    Bro, where did you get those dll files? None of them except SDL2 and SDL2 Image got downloaded for me.

  • @WhoIsDavis
    @WhoIsDavis 2 года назад +2

    Cmd error it says 'mingw32-make' is not recognized as an internal or external command,
    operable program or batch file.' FIX

    • @ArhamKhan05
      @ArhamKhan05 2 года назад

      ruclips.net/video/qLh84CmdBJ0/видео.html

  • @ThatOneRobloxDev
    @ThatOneRobloxDev Год назад +1

    Apart from the video being recorded in 720p @ 15hz, great video and explained really well!

  • @jcn1446
    @jcn1446 Год назад

    Mannnn you really save me. Thanks a lot.

  • @bread1205
    @bread1205 3 года назад +5

    this tutorial is amazing, however for some reason it gives me an error for "#include", any idea why?

    • @vaderdev
      @vaderdev  3 года назад +3

      well its because of the c/cpp extension. So basically its nothing wrong with yuor current setup just vscodes problem so u can hover over it the error and click on the quick fix button and then click on the disable error squiggly or something

    • @bread1205
      @bread1205 3 года назад

      oh ok thankzs

    • @Mabox-sc5iz
      @Mabox-sc5iz 2 года назад +1

      @@vaderdev I tried and it gives me an error when executing and it marks an error in that part

    • @creshfream3729
      @creshfream3729 2 года назад

      @@Mabox-sc5iz you probably don't have the SDL.h file

    • @duri616
      @duri616 2 года назад

      @@creshfream3729 how would i go about geting that file if im missing it?

  • @mathlover69
    @mathlover69 2 года назад +1

    mingw32-make: *** No targets. Stop.
    I got the error above after typing the same command in cmd(17:00). Help

  • @ThatOneSkywalker
    @ThatOneSkywalker Год назад +2

    SDL.h: No such file or directory gcc, i get this error :) could someone help me? i set up everthing the exact same as he did.

    • @ExtremeXperiece
      @ExtremeXperiece 9 месяцев назад

      Creating the "headers" folders for each of the "i686-w64-mingw32" and "x86_64-w64-mingw32" folders plus replacing "-Iinclude/sdl" with "-Iinclude/SDL2" from the MakeFile worked for me. Please note that the SDL folders' names change after updates. SDL2 may change once SDL3 become available or 20 depending when you read this.

  • @IndicaEnjoyer420
    @IndicaEnjoyer420 10 месяцев назад

    thanks bhai appreciate it accha tutorial hai

  • @MarianaSilva-bv1xh
    @MarianaSilva-bv1xh 2 года назад +1

    Sld_image has move to another site, now I don't know how to download. Can someone help me please??

  • @debrikislaw
    @debrikislaw 3 года назад +2

    triangle dev made new video 😳😳😳😳

  • @dedmem3.666
    @dedmem3.666 3 года назад

    ayyo man i love this video and your profile picture tho :o

    • @vaderdev
      @vaderdev  3 года назад

      haha thanks man!

  • @lilicui77
    @lilicui77 2 года назад

    Me hears analogy "ummm these are all the uhh each individual file is like a bone for SDL and it's glued together by duck tape" me ok ok

  • @marcus49494
    @marcus49494 6 месяцев назад

    hi guys may i ask why i followed the step but it show SDL.h: not such file or directory? n MakeFile cant compile

    • @NEXT_GAME-gh5gk
      @NEXT_GAME-gh5gk 3 месяца назад

      me too trying to slove it it happen to me with raylib too 2 days and im cracking it!

  • @ls167
    @ls167 2 года назад +2

    Hi scup I honestly found this really useful, so thank you. Do you know why my Main.exe file closes immediately after opening? This is an old video so I won't be surprised if you don't reply, but if you do that would be amazing.
    I have done some research but I am curious as to why yours didn't need any extra lines of code.

    • @vaderdev
      @vaderdev  2 года назад

      are u returning 0?

    • @ls167
      @ls167 2 года назад +1

      @@vaderdev haha no for some reason i completely missed the cin.get(). i don’t know how. thank you for replying though

  • @miraihajar2584
    @miraihajar2584 Год назад

    my compiler does not recognize the flags used in Makefile

  • @culturatecnologiayfuturo
    @culturatecnologiayfuturo Год назад

    For me this also was the only to work. But I didn't have the SDL.h file, and I don't have the #include even at first download, but it seems to be working with #include, does that work the same or should I solve this?

  • @averagejoe3468
    @averagejoe3468 2 года назад +1

    Got this problem.
    mingw32-make: MakeFile: No such file or directory
    mingw32-make: *** No rule to make target 'MakeFile'. Stop.
    Any idea what's the culprit?

    • @eskay7501
      @eskay7501 2 года назад

      i get this aswell, have you managed to solve it ?

    • @averagejoe3468
      @averagejoe3468 2 года назад

      Nope, I gave up

    • @oroshi858
      @oroshi858 Год назад

      @@eskay7501 soooo have you managed to solve this man ? xd

  • @Abhi_Codz
    @Abhi_Codz 3 года назад +2

    Noice!

  • @Xule72
    @Xule72 Год назад

    I got this error "g++: error: src/*.cpp: invalid argument"

  • @kendos9860
    @kendos9860 3 года назад

    Dang, thanks for this man. Good vid OwO b
    Also gotta say, I like your humour

    • @vaderdev
      @vaderdev  2 года назад +1

      aww thanks man! Just being myself infront of a computer lol

    • @creshfream3729
      @creshfream3729 2 года назад

      @@vaderdev lol

  • @shell4293
    @shell4293 Год назад

    all i get is "undefined reference to 'WinMain@16' ". Happens regardless of whether I use the makefile or type it out myself in the terminal.

    • @FolkloreDev
      @FolkloreDev Год назад

      Hey, bro. I don't know if you've resolved it. I also encountered the same problem, and I have two solutions to offer for reference. The first one is to add "#undef main" before "int main()." The second one is to download the "Code Runner" plugin, go to settings, search for "save," and find "Code-Runner: Save All Files Before Run" and check it.

  • @magniandrea
    @magniandrea 3 года назад +2

    when i try to run the program on vscode i get this error: "fatal error: SDL.h: No such file or directory". Does anyone know how to fix this? thanks in advance

    • @vaderdev
      @vaderdev  3 года назад

      hmmm how are u including sdl?

    • @alexandergebhard2993
      @alexandergebhard2993 2 года назад +2

      @@vaderdev i got the same problem, but the Main.exe is working and in cmd its it shows the same line as in the video above, did everythink exacly like in your vid.

    • @navkaransingh8900
      @navkaransingh8900 Год назад

      @@vaderdev #define SDL_MAIN_HANDLED
      #include "SDL.h"

  • @ventresurpates2659
    @ventresurpates2659 2 года назад +1

    Could you make a tutorial on how to fix the includePath update ? It's really annoying, I looked for several answers on internet, trying to find the solution, but it just didn't work...

  • @etheraelespeon1986
    @etheraelespeon1986 3 месяца назад

    That makefile is god damn horrifying and my GOD i wish I had found it like. 2 years ago lmao
    On one hand, ew. On the other hand, it actually explains what it's doing and isn't hidden under a layer of `$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp` cruft
    This tutorial is awesome for less experienced windows devs, and REALLY highlights how badly windows needs a package manager lmao
    Personally i would recommend the MSys2 environment, it configures most stuff for you and it comes with pacman, which Just Works:tm: most of the time.

  • @CRAVN
    @CRAVN 2 года назад

    Bro while doing the Makefile thing in the cmd, it gave me a collect2.exe Id returned 1 exit status error and recipe for target 'all' failed.

    • @CRAVN
      @CRAVN 2 года назад

      And I did not get a Makefile.exe

  • @quangat3533
    @quangat3533 Год назад

    Every time we want to run the program after editing we have to "makeflie" on cmd? too complicated!! anyone have a way to run them directly on vscode?

  • @dstails_4599
    @dstails_4599 2 года назад +1

    I tried running the cmd, however it tells me mingw32-make is not recognised as an internal or external command, I believe I copied everything over properly so I'm not sure what's going wrong

    • @vaderdev
      @vaderdev  2 года назад +1

      install mingw

    • @kenetramirez6358
      @kenetramirez6358 2 года назад

      Also make sure mingw\bin in C:\ is included in path

    • @sruffolo9303
      @sruffolo9303 2 года назад

      @@kenetramirez6358 I installed MingW and added it to path but i get this error
      mingw32-make: MakeFile: No such file or directory
      mingw32-make: *** No rule to make target 'MakeFile'. Stop.

    • @kenetramirez6358
      @kenetramirez6358 2 года назад

      @@sruffolo9303 what minute of the video are you in sorry?

    • @sruffolo9303
      @sruffolo9303 2 года назад

      @@kenetramirez6358 the part where he explains the command of how to run the main.cpp file

  • @ThatOneRobloxDev
    @ThatOneRobloxDev Год назад

    When I cut the folders in the SDL_image folder, It didnt create new DLL's like zlib

    • @ThatOneRobloxDev
      @ThatOneRobloxDev Год назад

      Its probably because they just made it more efficient after 1 year

  • @geetajuyal7115
    @geetajuyal7115 2 года назад

    My command is not working and saying that it is non-recognizable command even I have written the code

  • @cloudproblemssolved
    @cloudproblemssolved 5 месяцев назад +1

    10:43 My bin file for image-devel only has three files, only the dll files... 😔 😔
    EDIT: i followed through the tutorial anyway and it worked! the window displayed the message, i guess nothing else really mattered other than the dll files,
    thanks a million!

  • @dawsonwiesenhofer5216
    @dawsonwiesenhofer5216 9 месяцев назад

    What is the "MakeFile" because I don't get nothing called make file besides the name, what type of file is it.

  • @BenPisarik
    @BenPisarik 2 года назад

    The sdl image file does not appear as a zip file for me, and I am using the exact file you showed, any idea

  • @32.thinhvo60
    @32.thinhvo60 Год назад

    it gives the massage "#include error detected. Please update your includePath...".Can u help me?

  • @simra812
    @simra812 Год назад

    my Bin folder is missing the libjpeg.dll files. Why would it be so?

  • @dombread9559
    @dombread9559 2 года назад +1

    Mine gives the following error: fatal error: SDL.h: No such file or directory
    #include
    HELP ME!

    • @creshfream3729
      @creshfream3729 2 года назад

      you probably forgot to take a file?

    • @creshfream3729
      @creshfream3729 2 года назад

      you probably forgot to include sdl

    • @ArhamKhan05
      @ArhamKhan05 2 года назад

      bro it's "mingw32-make -f MakeFile"

    • @tngdwn8350
      @tngdwn8350 2 года назад

      You probably didn't set an include path. Just click on the error in the code and press "Quick fix", VSCode will generate a file to set up your include path. (Also install the C/C++ extension maybe)

  • @lorenzocampa
    @lorenzocampa 3 года назад

    Pls help i have this error: g++: error: src/*.cpp: No such file or directory can you help me pls?

  • @_slier
    @_slier 3 года назад +1

    hmm, is this series gonna end up like any other sdl tutorial? stop half way?

    • @vaderdev
      @vaderdev  3 года назад

      I hope not... I think i will finish a full game for this series but each video will be uploaded with a large time gap between them since i will have school

    • @craigdanielmaceacher
      @craigdanielmaceacher 2 года назад

      99% guaranteed.

  • @RugiSerl
    @RugiSerl 2 года назад

    I followed the tutorial and it seemed to go well, but when I try to run the Main.exe I get a windows error saying that the program can't run on my pc. I'm new to this kind of thing so I don't know what could be the cause(mingw, sdl ?), so it would be great if someone knew what causes this

    • @vaderdev
      @vaderdev  2 года назад

      sorry for the late reply but make sure to add the dll's into the folder where the exe is stored

  • @theweirdcookiez4291
    @theweirdcookiez4291 3 года назад +1

    Thank you!

    • @vaderdev
      @vaderdev  3 года назад

      np glad i could help :)

  • @robsonrobkido767
    @robsonrobkido767 Год назад

    Alternatively, someone could just provide a downlaod link for the sdl_image

  • @eshandev
    @eshandev Год назад

    collect2.exe: error: ld returned 1 exit status
    MakeFile:2: recipe for target 'all' failed
    mingw32-make: *** [all] Error 1
    this is the error im getting

  • @hello.4693
    @hello.4693 Год назад

    Is MinGW the best option? i though is kinda dead. I am using MSYS2 / UCRT64 actually.

    • @reecesellers
      @reecesellers 11 месяцев назад +1

      UCRT64 will work, but it was so inconsistent it only works on my desktop and not my laptop. So far I've seen success on my laptop with the equally inconsistent Cygwin setup and installing all the mingw libraries as needed.

  • @quangat3533
    @quangat3533 Год назад

    and how to run it in visual studio code? please help me!!!

  • @kurai-izanagi3231
    @kurai-izanagi3231 2 года назад

    very nice tutorial please do more :(

    • @vaderdev
      @vaderdev  2 года назад

      there are 3 more vids :)

  • @bobbyhill629
    @bobbyhill629 7 месяцев назад

    thank you +1 subscribers

  • @yakassab44
    @yakassab44 2 года назад

    this sdl2 image thing just doesnt exist or sth please help

  • @lorenzomedici8675
    @lorenzomedici8675 3 года назад +1

    don't answer me .... it's worked thanks man

    • @vaderdev
      @vaderdev  3 года назад

      oh lol ye it happens and it is quite annoying but thats c++ for yeh

  • @kadekedwin
    @kadekedwin 2 года назад

    bro, in the website download page there are source code, for what is that? and why you don't download it?

    • @vaderdev
      @vaderdev  2 года назад

      cuz i dont want to compile the code

  • @xarcraft2021
    @xarcraft2021 10 месяцев назад

    10:01 If you cut the folder don't delete it :)

  • @midou6104
    @midou6104 Год назад +1

    i dont have a many dll as you i faind just two dll files

  • @bakirhs8596
    @bakirhs8596 2 года назад

    Tank You Very Much man !!!

  • @codepro-i1e
    @codepro-i1e Год назад

    not working its not showing in vs code it says error

  • @abdielnunez8342
    @abdielnunez8342 2 года назад

    yey

  • @sakshamrajbhandari126
    @sakshamrajbhandari126 Год назад

    Please help,
    So, I typed exactly the same as of video in CMD
    mingw32-make -f MakeFile
    after that it shows this:
    g++ -Iinclude -Iinclude/sdl -Iinclude/headers -Llib -o Main src/*.cpp -lmingw32 -lSDL2main -lSDL2 - lSDL_image
    g++: error: -E or -x required when input is from standard input
    MakeFile:2: recipe for target 'all' failed
    mingw32-make: *** [all] Error 1

  • @RobertCastilloC
    @RobertCastilloC 2 года назад

    Is it possible to install SDL globally so you don't have to copy the files everytime you create a new project

    • @vaderdev
      @vaderdev  2 года назад

      yes

    • @vaderdev
      @vaderdev  2 года назад

      in the makefile you will have to specify the path of both the lib and include folder of the path you plan on using

    • @vaderdev
      @vaderdev  2 года назад

      but it isnt recommended for projects which will be shipped to multiple platforms

    • @RobertCastilloC
      @RobertCastilloC 2 года назад

      Ok thank you make great videos

  • @lserranoit
    @lserranoit 2 года назад

    Is there a way to doit without a make file? I cant make it work with hpp files.

    • @vaderdev
      @vaderdev  2 года назад

      try h files then if hpp isnt working

    • @vaderdev
      @vaderdev  2 года назад

      else make a bat file if ur on windows

  • @rampalsinghshishodia9106
    @rampalsinghshishodia9106 2 года назад

    Makefile: no such file or directory
    No rule to make target 'Makefile'. Stop.
    in CMD

  • @Kirbychu1
    @Kirbychu1 Год назад

    thx bro

  • @Skyc4t99
    @Skyc4t99 2 года назад +3

    Hey bro! Thanks for the awesome tutorial but i have a question. When I run the MakeFile on the cmd I get this error.
    c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../libmingw32.a(main.o):(.text.startup+0xa0): undefined reference to `WinMain@16'
    collect2.exe: error: ld returned 1 exit status
    MakeFile:2: recipe for target 'all' failed
    mingw32-make: *** [all] Error 1
    On my vscode I have all the .dll in the main directory, maybe thats the problem? Thanks so much again!

    • @c4rbon_free521
      @c4rbon_free521 2 года назад +8

      Hi, I had the same issue, and I read an article that instructed me to include the line :-
      #define SDL_MAIN_HANDLED before including "SDL.h".. Worked for me, and I hope it does for you too!
      Cheers

    • @joshrayner7167
      @joshrayner7167 2 года назад

      @@c4rbon_free521 thank you soooo much!!

    • @SuperShortAndSweet
      @SuperShortAndSweet 2 года назад +1

      @@joshrayner7167 hey look into SDL_SetMainReady
      SDL Wiki
      SDL_SetMainReady /. /this is the function
      Circumvent failure of SDL_Init() when not using SDL_main() as an entry point.
      Syntax
      void SDL_SetMainReady(void);
      Remarks
      This function is defined in SDL_main.h, along with the preprocessor rule to redefine main() as SDL_main(). Thus to ensure that your main() function will not be changed it is necessary to define SDL_MAIN_HANDLED before including SDL.h.
      Version
      This function is available since SDL 2.0.0.
      Code Examples
      #define SDL_MAIN_HANDLED
      #include "SDL.h"
      int main(int argc, char *argv[])
      {
      SDL_SetMainReady();
      SDL_Init(SDL_INIT_VIDEO);
      ...
      SDL_Quit();
      return 0;
      }
      Related Functions
      SDL_Init

    • @joshrayner7167
      @joshrayner7167 2 года назад

      @@SuperShortAndSweet thanks!

    • @SuperShortAndSweet
      @SuperShortAndSweet 2 года назад +1

      @@joshrayner7167 so since sdl_main isn't the entry point your main needs to be the same as above because you're now handling windows api, so you loses your portability because you now invoke window api then you provoke sdl api . I don't do it but I imagine you could use cmake to build window api which can sdl2 api (take all this with grain of salt (mainly the cmake stuff))

  • @TrickyDevs
    @TrickyDevs 2 года назад

    thanks PolyMars

  • @dedmem3.666
    @dedmem3.666 3 года назад

    in the cmd it shows me that the command mingw32-make cant be found or is wrong written. can you help me out?

    • @vaderdev
      @vaderdev  3 года назад

      ofc! I think u need to add mingw to ur path so if ur on windows u can hit windows and search for env and add it to ur system or environmental variables

    • @dedmem3.666
      @dedmem3.666 3 года назад

      @@vaderdev sry bud i couldnt follow up im kinda new into these things could u give me a depth instruction how to do what ? :(

    • @vaderdev
      @vaderdev  3 года назад

      @@dedmem3.666 its kind of hard to explain here on youtube do u use discord?

    • @marcelvelasquez_1
      @marcelvelasquez_1 3 года назад

      I have the same problem, and mingw is in my path
      with g++ --version (in cmd) it showed me, that i had instlled it

    • @vaderdev
      @vaderdev  3 года назад

      @@marcelvelasquez_1 hmmmm well maybe u installed a wrong one like an older version of mingw so i guess download the newest version and see if it works

  • @pastifier9349
    @pastifier9349 2 года назад

    Your Discord isn't in the description D':

    • @vaderdev
      @vaderdev  2 года назад

      discord.gg/spVQfM92Jn

  • @spekulatiu
    @spekulatiu 3 года назад

    ayo
    it says "mingw32-make" is either spelled wrong or doesnt exist.
    u have a idea how i fix this?
    great tutorial to this point btw

    • @vaderdev
      @vaderdev  3 года назад

      uh did u install mingw?

    • @spekulatiu
      @spekulatiu 3 года назад

      @@vaderdev i installed it now, still not working

    • @vaderdev
      @vaderdev  3 года назад

      @@spekulatiu did u add it to ur systempath

    • @spekulatiu
      @spekulatiu 3 года назад

      @@vaderdev what is a system path

    • @spekulatiu
      @spekulatiu 3 года назад

      Do you mean the Weird environment variables?

  • @basicallybrand
    @basicallybrand 2 года назад

    you windows guys are lucky

    • @vaderdev
      @vaderdev  2 года назад

      lol now im on linux... lmao

  • @バイナリフォックスゼロ
    @バイナリフォックスゼロ 2 года назад

    what the game you make I install?