Added a solution to a common issue on linux systems where library would't be linked and added common issues section.

master
MCForsas 4 years ago
parent
commit
4a166654bf
1 changed files with 22 additions and 1 deletions
  1. +22
    -1
      Working-on-GNU-Linux.md

+ 22
- 1
Working-on-GNU-Linux.md

@ -151,4 +151,25 @@ cc main.o -s -Wall -std=c99 -I/opt/raylib/src -L/opt/raylib/release/libs/linux -
### The simplest possible build command
```
cc main.c -lraylib -lGL -lm -lpthread -ldl -lrt -lX11
```
```
## Common issues
#### I get an error: `error while loading shared libraries: libraylib.so.351: cannot open shared object file: No such file or directory` after rebooting. Right after building the library it worked fine.
If you install raylib with `RAYLIB_LIBTYPE=SHARED` you may find that compiler is unable to locate library file. That is because raylib wasn't installed to stander system library directories. You can check in which directory raylib was installed by looking at the `make install` output:
```
<...>
cp --update --verbose /home/<USERNAME>/<PATH_TO_RAYLIB>/raylib/libraylib.so.3.5.0 /usr/local/lib/libraylib.so.3.5.0
<...>
```
In this case raylib was installed to `/usr/local/lib`, but it can be that raylib gets installed into `/usr/local/lib64` or some other directory. You should check the output yourself and make sure, that missing files are located in that directory.
Next all you need to do is either specify that install path in the makefile or set an enviroment variable. You can set an enviroment variable by typing:
`export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib` (replace `/usr/local/lib` with your install path)
You can append this command to the end of your `~/.bashrc` or `~/.zshrc` or other user login script, to make the change permanent. If you do so you'll be able to compile right away after you relogin. If you don't want to relogin just run `source <YOUR USER LOGIN SCRIPT>`

Loading…
Cancel
Save