2

I have installed boost and cpp-netlib and successfully ran all tests. I can compile the following example from the command line with the following options:

clang++ -o test main.cpp \
-I/path.../cpp-netlib-0.11.1-final \
-I/path.../boost_1_57_0 \
-L/path.../boost_1_57_0/stage/lib \
-L/usr/local/lib \
-lboost_system \
-lboost_thread \
-lcppnetlib-uri \
-lcppnetlib-client-connections \
-lssl \
-lcrypto \
-pthread

Example from cpp-netlib.org:

#include <boost/network/protocol/http/client.hpp>
#include <iostream>

int main(int argc, char *argv[]) {
    using namespace boost::network;

    if (argc != 2) {
        std::cout << "Usage: " << argv[0] << " [url]" << std::endl;
        return 1;
    }

    http::client client;
    http::client::request request(argv[1]);
    request << header("Connection", "close");
    http::client::response response = client.get(request);
    std::cout << body(response) << std::endl;

    return 0;
}

Running this program:

./test "url"

Successfully displays the html code of website.

I am running into a problem when I try to import this example into Xcode. I have included the correct search paths for header files and binaries. The code will compile but Xcode crashes every time it reaches this line.

http::client::request request(argv[1]);

I can comment out this line and everything after it and the program compiles and runs. Otherwise it crashes, even when trying to use a breakpoint. Any suggestions would be appreciated.

1
  • I'm having the same issue using Xcode 6.3.2. Commented Jun 12, 2015 at 9:42

1 Answer 1

1

This is because of the URI parser generating really big symbols in debug builds. The use of Boost.Spirit in the URI parsing uses very heavy template metaprogramming and that shows up as very long symbols which may not be handled appropriately by the system. I'm not sure whether there are work-arounds here as I don't use the Xcode IDE for regular development of cpp-netlib.

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.