0

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.

3
  • I think you need to tell about these files to linker through some flag(For example /MAPINFO:EXPORTS on windows) Commented May 4, 2015 at 9:22
  • Hi Rahul, I am working on OSX 10.9 What I believe is there should be a place for these libraries in boost directly structure itself, if placed there correctly they should get linked automatically ( Considering the project I am working on is already using boost libraries which requires building and I don't do anything special to use libraries like filesystem which needs to be build ). So I need to know the place in boost root directory where these files are required to place. Commented May 4, 2015 at 9:27
  • Perhaps Dipak said is correct. You will have to tell linker where the libraries are. Commented May 4, 2015 at 12:15

1 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.