Loading...
> Setting Up Our Project And SDL
View Course

Question by Thomas Treffry

Hey, any idea how to set up this project on linux? I am using regular make which worked for hello world but doesn't seem to be working now that I'm trying to call SDL_Window. It has stopped recognizing my code changes and says make is up to date, event though it isn't. I downloaded the mingw version of sdl2 and copied the files from the i686 folder. I was following along with the video but maybe that wasn't the right thing to do?

Answered by Daniel McCarthy

Hi, Unfortunetly I can be of limited help when you divert from the course content. I recommend following the course on Windows as shown. Then later you can work on migrating to Linux. If you insist on using Linux you must use GCC and you will be responsible for ensuring you install the correct development packages for SDL. Off the top of my head I believe the Linux package to install on debian is. libsdl2-dev

Answered By Instructor

Followup question by Thomas Treffry

I figured it out. You don't need to do any of the downloads and copy/pasting files on linux.

Just install SDL2 with your package manager (it was already installed for me on Manjaro). Then build with these flags `gcc -g -lSDL2 -lSDL2main ./src/main.c -o ./bin/main`.

Make is still giving me issue where it doesn't detect my changes when building after making a change. However, I am able to work around that by called `gcc` directly.

Here is the linux guide I found that was able to help me set it up: https://gigi.nullneuron.net/gigilabs/how-to-set-up-sdl2-on-linux/

Question Author

Answered by Daniel McCarthy

Yes that's the sdl dev package I was talking about. Make sure you also have the dev version not just the binary releases apt install libsdl-dev

Answered By Instructor

Answered by Daniel McCarthy

libsdl2-dev*

Answered By Instructor

Followup question by Thomas Treffry

Thanks!

Question Author