I wanted to compile a task using SDL in C++ and I wanted to run the generated executable on another Linux that does not have this library installed, so how can I compile it in a way that I can include dependencies of SDL for running on another computer with Linux without the SDL installed?
Generate executable with no dependencies on Linux
341 views Asked by Pedro J At
2
You can just deploy your program with libraries it needs and use
LD_LIBRARY_PATH
to specify where to look for libs. It will allow user to use newer versions of libraries. (latest SDL2 already have this even if linked statically, but it isn't the same for other libraries).If you don't have static libSDL.a (or libSDL2.a), you can easily build it. Standard build will produce both
.a
and.so
, or use--enable-static
if for some reasons your configuration is different.