I’m trying to run my game on another PC with the same distro of mine. But it returns me this following error:
error while loading shared libraries: libSDL2-2.0.so.0: cannot open object file: no such file or directory
To compile I use this command (on QtCreator, to be more specific):
g++ -Wl,-rpath,/home/daniel/Qt/5.11.1/gcc_64/lib -o untitled main.o Entity.o Game.o GamePanel.o GameSolids.o MainThread.o Player.o TextureManager.o Level.o Stage.o Enemy.o EnemiesManager.o GlobalConstants.o -lX11 -L/home/daniel/QtProjects/untitled/…/…/…/…/usr/lib/x86_64-linux-gnu/ -lSDL2 -lSDL2_image -lGL -lSDL2-2.0 -lSDL2main -L/home/daniel/Qt/5.11.1/gcc_64/lib -lQt5Core -lpthread
That is, in my PC the game runs because the libraries are installed, but I don’t want the user needs to install additional libraries to run the game, I want the libraries goes together with the game. How can I do it?
I was reading about static libraries but, until then, I think I was using it on that command I wrote. It would be like a .dll arquives on Windows. Would this be the solution?
My SO is Linux Ubuntu 18.