I want to use SDL2 under Linux and Win within a C++ project. Can I just add the source code to my project and expect it to work? Are there some special dependencies? Thanks!
edit: this is the first time Im trying SDL.
I want to use SDL2 under Linux and Win within a C++ project. Can I just add the source code to my project and expect it to work? Are there some special dependencies? Thanks!
edit: this is the first time Im trying SDL.
You need to install it first.What version of Linux are you using?
I'm not sure how to do it on every platform, but I know you can install it via your package manager on Fedora and Arch. On Ubuntu or Miny you can follow this guide.
$ g++ main.cpp -o sdl-test `sdl-config --cflags --libs`
You can manually invoke the sdl-config to see what arguments it is passing to the compiler / linker. Generally, you don't actually build directly on the command line but instead using some kind of Make like tool and/or an IDE. You'll need to figure out how to ensure the relevant command line arguments are passed to the compiler / linker on a per-tool basis.Thanks! Ive installed it on Linux, included the libs/header and it works fine. I guess I wont need to compile it myself.
You need to install it first.What version of Linux are you using?
Kubuntu. Ive found it through the package manager(libsdl2 and libsdl2-dev).
Thanks! Ive installed it on Linux, included the libs/header and it works fine. I guess I wont need to compile it myself.
You need to install it first.What version of Linux are you using?
Kubuntu. Ive found it through the package manager(libsdl2 and libsdl2-dev).
That's great! I'm glad they decided to add SDL2, much easier than having to compile it yoursefl.