The test binary gets this error on execution:
"error while loading shared libraries: libxcb-errors.so.0: cannot open shared object file: No such file or directory".
Part of Makefile
:
...
TARGET = mylib.so
LIBS_DYNAMIC = $(shell pkg-config --libs xcb-errors)
$(TARGET): $(OBJ)
$(CC) -shared -o $@ $^ $(CFLAGS) $(LIBS_DYNAMIC)
$(TEST): $(TEST-SRC) $(BIN)
$(CC) $(TEST-SRC) -o $@ $(PREFIX_LIB)/$(TARGET)
...
The dynamic library is created, then the test file linked to the library. When the test file gets executed the error pops up. I don't know how to overcome it. This is my question.
# ldconfig -v | grep xcb
329 /usr/local/lib:
330 libxcb-errors.so.0 -> libxcb-errors.so.0.0.0
# pkg-config --libs xcb-errors
-L/usr/local/lib -lxcb-errors -lxcb
# stat /usr/local/lib/libxcb-errors.so.0
/usr/local/lib/libxcb-errors.so.0 -> libxcb-errors.so.0.0.0
# stat /usr/local/lib/libxcb-errors.so.0.0.0
## the file exists
I am not proficient in all this linking magic, but as of my knowledge the link step should went OK. How to link properly?