There are many question asked regarding this issue for example.
I have the library in the path as mentioned in the above link.
export LD_LIBRARY_PATH=/home/mydir/boost_1_66_0/stage/lib
I am using eclipse oxygen
, where I added the libraries of boost and pthread like
-l
boost_serialization
pthread
and included the linker path -L /home/mydir/boost_1_66_0/stage/lib
and compiler path -l /home/mydir/boost_1_66_0
. When I test the program of two files for example thread.cpp
and thread.h
, it is working fine. But when I include more files it gives me the errror
error while loading shared libraries: libboost_serialization.so.1.66.0: cannot open shared object file: No such file or directory
I am not sure what is going wrong with more files and gives the linking error.
Edit
I tried using makefile
, which has something like
CXX = g++
DEBUG = -g
CXXFLAGS = -Wall $(DEBUG) -std=c++17 -boost_serialization -pthread
and it goes on compiling and end with
Building target: Test
Invoking: Cross G++ Linker
g++ -std=c++17 -L/home/mydir/boost_1_66_0/stage/lib -o "Test" ./decodenumbers.o ./encodechars.o ./help.o ./index.o ./inputparameters.o ./loadindex.o ./main.o ./match.o ./output.o ./readfastqfiles.o ./report.o ./reversestrand.o ./samformat.o ./saveindex.o ./time.o ./trimreads.o ./validate.o ./version.o -lboost_serialization -lpthread
Finished building target: Test
When I run, it gives the same issue.