PRIME
PRIME

Reputation: 1078

Integrating cpp-netlib to pre-existing boost package

I am trying to integrate cpp-netlib to my pre-existing boost package and use it in my program.

I am simply including:

#include <boost/network/uri.hpp>

and trying to use it like this:

boost::network::uri::uri u("http://google.com");

While trying to do so I am getting a linker error:

Undefined symbols for architecture x86_64:

  "boost::network::uri::detail::parse(std::__1::__wrap_iter<char const*>, std::__1::__wrap_iter<char const*>, boost::network::uri::detail::uri_parts<std::__1::__wrap_iter<char const*> >&)", referenced from:
      boost::network::uri::uri::parse() in Watcher.o

What I have done so far is to download cpp-netlib, building it using cmake, I believe that was successful since I can see following 3 libraries:

libcppnetlib-client-connections.a
libcppnetlib-server-parsers.a
cppnetlib-uri.a

So my question is where should I place the 3 static libraries which I have generated in order to ensure correct linking. I already can see some library files inside directory:

-Boost
     -bin.v2

Is this the place where I have to keep my libraries to ensure correct linking.

Upvotes: 0

Views: 208

Answers (1)

Dipak D Desai
Dipak D Desai

Reputation: 877

You should specify a library path for cpp-netlib (-L) and libraries to link (-l):

-lcppnetlib-client-connections.a
-lcppnetlib-server-parsers.a
-lcppnetlib-uri.a 

There is no place to put above libraries in boost folder structure. You have to pass argument when you compile you application.

Upvotes: 0

Related Questions