SDL 2 Tutorial Change Background Colour

Поділитися
Вставка
  • Опубліковано 31 січ 2025

КОМЕНТАРІ • 10

  • @bofoitakoyaki9859
    @bofoitakoyaki9859 Рік тому

    So i loaded anc compiled everything. But when i run without debugging it gives me an error. If i press debug anyway, A red screen pops up.
    when i go back to my code I see:
    #include
    ^
    with the red squiggles here
    what does this mean? it says: "SDL2/SDL.h: No such file or directorygcc"
    but ive clicked the include paths quick fix and everything.
    It runs and can be compiled, but I dont wanna see it having this Ghost error.
    What do I do?

    • @SonarSystemsCoUk
      @SonarSystemsCoUk  Рік тому

      how did you setup SDL?

    • @bofoitakoyaki9859
      @bofoitakoyaki9859 Рік тому

      @@SonarSystemsCoUk with your tutorial, i spent a while making sure every single step was followed, im guess there's just some weird problem with vscode and it ackowledging the include or something

    • @alejandroreyes2926
      @alejandroreyes2926 Рік тому

      Did you ever get it to work?

    • @bofoitakoyaki9859
      @bofoitakoyaki9859 Рік тому

      yes but i have an even stranger include error with Vs code and it does not go away even if I go to my laptop and do the whole process over again... Includes are hard...
      @@alejandroreyes2926

    • @emeliaprice6558
      @emeliaprice6558 10 місяців тому

      The tutorial doesn't cover connecting SDL to the run button. You gotta run the program either through the console with 'make' then './main' (to run) or by navigating to the .exe in windows and manually clicking it.

  • @ranndomThinngs
    @ranndomThinngs Рік тому +1

    sorry for commenting here, from your tutorial video of setup of SDL2
    i used this in terminal g++ -I src/include -L src/lib -o main main.cpp -lmingw32 -lSDL2main -lSDL2
    and i am getting error like this showing undefined reference to every function
    c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\DASARI~1\AppData\Local\Temp\cc0nk7a2.o:main.cpp:(.text+0x26): undefined reference to `SDL_Init'
    pp:(.text+0xaa): undefined reference to `SDL_RenderClear'
    c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\DASARI~1\AppData\Local\Temp\cc0nk7a2.o:main.cpp:(.text+0xd6): undefined reference to `SDL_SetRenderDrawColor'
    c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\DASARI~1\AppData\Local\Temp\cc0nk7a2.o:main.cpp:(.text+0xf2): undefined reference to `SDL_RenderDrawPoint'
    c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\DASARI~1\AppData\Local\Temp\cc0nk7a2.o:main.cpp:(.text+0xfe): undefined reference to `SDL_RenderPresent'
    c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\DASARI~1\AppData\Local\Temp\cc0nk7a2.o:main.cpp:(.text+0x10a): undefined reference to `SDL_Delay'
    collect2.exe: error: ld returned 1 exit status
    please help me with this

    • @emeliaprice6558
      @emeliaprice6558 10 місяців тому

      UA-cam deleted my other comment. Basically make sure you have 'make' installed.

  • @MaxPenelope-w4j
    @MaxPenelope-w4j 5 місяців тому

    Thompson Kevin Clark Dorothy Thompson Kenneth