I am doing a project that uses sdl2 and sdl-image on linux, i have the following directoy structure:
total 20
drwxrwxr-x 3 lucas lucas 4096 Feb 17 16:58 assets
drwxrwxr-x 2 lucas lucas 4096 Feb 20 12:57 bin
-rw-rw-r-- 1 lucas lucas 202 Feb 19 19:20 Makefile
drwxrwxr-x 2 lucas lucas 4096 Feb 17 21:51 src
drwxrwxr-x 4 lucas lucas 4096 Feb 17 21:39 third-party
and the following makefile:
CXXFLAGS = -w -Ithird-party/include
LDFLAGS = -Lthird-party/lib/SDL2 -lm -lSDL2main -lSDL2 -lSDL2_image
main: $(wildcard src/*.cpp)
g++ $(CXXFLAGS) $^ $(LDFLAGS) -o bin/main
run:
./bin/main
It builds with no problems but when executing: make run i get the following error:
./bin/main
./bin/main: error while loading shared libraries: libSDL2-2.0.so.0: cannot open shared object file: No such file or directory
make: *** [Makefile:8: run] Error 127
and these are the third-party/lib/SDL2 folder contents:
total 27436
lrwxrwxrwx 1 lucas lucas 23 Feb 19 21:29 libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.3000.0
-rwxr-xr-x 1 lucas lucas 8718240 Feb 19 21:24 libSDL2-2.0.so.0.3000.0
-rw-r--r-- 1 lucas lucas 15965264 Feb 19 21:24 libSDL2.a
lrwxrwxrwx 1 lucas lucas 28 Feb 19 21:29 libSDL2_image-2.0.so.0 -> libSDL2_image-2.0.so.0.800.2
-rwxr-xr-x 1 lucas lucas 858864 Feb 19 21:25 libSDL2_image-2.0.so.0.800.2
-rw-r--r-- 1 lucas lucas 1621862 Feb 19 21:25 libSDL2_image.a
-rwxr-xr-x 1 lucas lucas 1036 Feb 19 21:25 libSDL2_image.la
lrwxrwxrwx 1 lucas lucas 28 Feb 19 21:29 libSDL2_image.so -> libSDL2_image-2.0.so.0.800.2
-rwxr-xr-x 1 lucas lucas 951 Feb 19 21:24 libSDL2.la
-rw-r--r-- 1 lucas lucas 3948 Feb 19 21:24 libSDL2main.a
-rwxr-xr-x 1 lucas lucas 876 Feb 19 21:24 libSDL2main.la
lrwxrwxrwx 1 lucas lucas 23 Feb 19 21:29 libSDL2.so -> libSDL2-2.0.so.0.3000.0
-rw-r--r-- 1 lucas lucas 901654 Feb 19 21:24 libSDL2_test.a
-rwxr-xr-x 1 lucas lucas 879 Feb 19 21:24 libSDL2_test.la
What is the problem,i can t get it to work....!!???