I'm writing two C programs. One of them uses library libnsd.so
. I compile two C programs using makefile which looks like this:
CC=gcc CFLAGS= -Wall -g -O -fPIC RM= rm HLAV=main HLAVO=main.o all:lib $(HLAV) cc c2.c -o c2 main: $(HLAVO) $(CC) -L. -o $(HLAV) $(HLAVO) -lnsd lib: libnsd.so libnsd.so: nsd.o nd.o $(CC) -shared $< -o $@ nsd.o: nsd.c nsd.h nd.h nd.o: nd.c nsd.h nd.h clean: $(RM) -rf *.o *.so main
When I try to run an aplication I get an error:
error while loading shared libraries: libnsd.so: cannot open shared object file: No such file or directory
Anyone knows how to solve it?