Linking a new library into IcePatch2

EwgenijkkgEwgenijkkg Ewgenij SokolovskiOrganization: RWTHProject: RoveMember ✭✭
Hello, I want to extend the code of the Server of IcePatch2. I want to use the boost library for that purpose. So I added
#include "boost/filesystem/operations.hpp" to the include instructions of the file Server.cpp. Then I have written my code using the functionality of boost. The problem is now that the boost library is not linked when I execute "make". I got the following error message:
../../lib/libIcePatch2.so: undefined reference to `boost::filesystem::path::path[in-charge](std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: ld returned 1 exit status

So I have to modify the Makefile somewhere apparently. But where?

Comments

  • beaglesbeagles Brent EaglesOrganization: Eagles Technologies IncProject: Asterisk SCFMember ✭✭✭
    Adding the boost library to the LINKWITH line in the IcePatch2 Makefile should work.
  • EwgenijkkgEwgenijkkg Ewgenij SokolovskiOrganization: RWTHProject: RoveMember ✭✭
    Answer

    Ah, I just found an option by myself. I added -lboost_filesystem to the $(SERVER) target so it looks now

    $(SERVER): $(SOBJS) $(LIBTARGETS)

    $(CXX) $(LDFLAGS) -lboost_filesystem -o [email protected] $(SOBJS) $(OPENSSL_RPATH_LINK) -lIcePatch2 $(LIBS)

    and it works. I tried to add -lboost_filesystem to the LINKWITH line before, but it didn't work out for some reason.
  • beaglesbeagles Brent EaglesOrganization: Eagles Technologies IncProject: Asterisk SCFMember ✭✭✭
    Ah of course, you're right. More coffee required this morning ;) LINKWITH is for the shared library, not the server.
Sign In or Register to comment.