7

I'm new to c++ rest sdk Casablanca and using it in Codelite ide.
Operating System : Arch Linux
gcc version : 6.1.1
While building the code I get the following error in debug mode:

/bin/sh -c '/usr/bin/make -j4 -e -f  Makefile'
----------Building project:[ Casa - Debug ]----------
make[1]: Entering directory '/home/vinci/Documents/CPP_Projects_Programs/Casa'
/usr/bin/g++  -c  "/home/vinci/Documents/CPP_Projects_Programs/Casa/main.cpp" -g -O0 -fopenmp -std=c++14 -std=c++11 -Wall  -o ./Debug/main.cpp.o -I. -I/usr/local/include/cpprest -I/usr/local/include/pplx -I/home/vinci/casablanca/Release/src -I. -I/usr/local/include/cpprest -I/usr/local/include/pplx
/usr/bin/g++ -o ./Debug/Casa @"Casa.txt" -L. -L/usr/local/lib -L/usr/lib64 -L/usr/lib  -lcpprest
/usr/bin/ld: ./Debug/main.cpp.o: undefined reference to symbol '_ZN5boost6system15system_categoryEv'
/usr/lib/libboost_system.so.1.60.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[1]: *** [Casa.mk:79: Debug/Casa] Error 1
make[1]: Leaving directory '/home/vinci/Documents/CPP_Projects_Programs/Casa'
make: *** [Makefile:5: All] Error 2
====1 errors, 0 warnings, total time: 00:00:14 seconds====

I searched this on Stackoverflow before asking and most of the answers just pointed to linking the libraries properly in project settings and I have done that as one can see in the code above but still keeps giving the error and I don't know what am i missing??

A little Help would be appreciated... Thank You

Anmol
  • 309
  • 1
  • 3
  • 15

2 Answers2

15
/usr/lib/libboost_system.so.1.60.0: error adding symbols: DSO missing from command line

This DSO error means that libboost_system is missing from the command line. You should also add:

-lboost_system

to your command line just like -lcpprest

fatihk
  • 7,509
  • 22
  • 44
  • Thanks a lot @AngelinaJolly for help that worked but now it gives the error of : `error while loading shared libraries: libcpprest.so.2.8` – Anmol Jul 29 '16 at 08:03
  • @Anmol_Sharma, you can check -L/usr/local/lib -L/usr/lib64 -L/usr/lib folders if that .so exists – fatihk Jul 29 '16 at 08:04
  • @AnjelinaJolly I've done that as you can see above in the debug log and yes the file libcpprest.so.2.8 does exist in /usr/local/lib but it still is giving that error don't know why.. – Anmol Jul 29 '16 at 08:09
  • @Anmol_Sharma, if you are building in 64 bit, libcpprest should also be 64bit – fatihk Jul 29 '16 at 08:30
  • @AnjelinaJolly any idea how to do that?? – Anmol Jul 29 '16 at 08:42
  • @Anmol_Sharma, you can download it here: http://packages.ubuntu.com/xenial/libcpprest2.8 – fatihk Jul 29 '16 at 09:04
  • @AnjelinaJolly thank you for providing this link but I just found the whole cpprestsdk package on Arch linux **AUR** and after doing a complete install from it solved the problem.. But anyway `Thanks a Ton` for your help, I really appreciate it – Anmol Jul 29 '16 at 09:41
0

This can happen if you reference libraries in the wrong order. I have a personal library that depends on -lboost_system, but I had listed my own library after the boost library and was getting this error. I moved my personal library to the front of the list, and the error went away.

Joseph Larson
  • 4,851
  • 1
  • 15
  • 25