I have a Makefile for a C ++ Linux project:
MODE ?= dbg DIR = ../../../../../somdir/$(MODE) SRC_FILES = a.cpp b.cpp H_FILES = ah LDFLAGS += -L$(DIR)/lib/linux '-Wl,-R$$ORIGIN' CPPFLAGS = -I$(DIR)/include LIBRARIES = -lsomeso ifeq (rel, $(MODE)) CFLAGS = -Wall -g -DNDEBUG else CFLAGS = -Wall -ansi -pedantic -Wconversion -g -DDEBUG -D_DEBUG endif sample: $(SRC_FILES) $(H_FILES) Makefile g++ $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(LIBRARIES) $(SRC_FILES) -o sample
when I run 'make', it builds the project without errors. but when I run the project, he complains that:
error while loading shared libraries: libsomeso.so: cannot open shared object file: No such file or directory
The path I give to DIR goes to the folder where the shared object is located (relative to where the makefile is located), and if that was the wrong path, why didn't it complain during the make process.
Does anyone know what I am missing?
Thanks Matt
source share