0

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.

AwaitedOne
  • 992
  • 3
  • 19
  • 42
  • 1
    @Hamed I have already mentioned that I have the library in the path. – AwaitedOne Apr 14 '18 at 10:29
  • Try compiling with the flag `-pthread` rather than link the `pthread` library directly – Galik Apr 14 '18 at 10:35
  • @Galik I tried using `makefile`, please check the edit above. – AwaitedOne Apr 14 '18 at 11:57
  • @Galik I am surprised to see this morning that the running of the code does not complain about anything (when I tried to look into the issue after a couple of days). Maybe my machine wanted me to take some rest or machine needed some rest, not sure. Anyway happy, but not sure about the issue. – AwaitedOne Apr 17 '18 at 07:16

0 Answers0