Error C3083 '`global namespace'': the symbol to the left of a '::' must be a type cpprestsdk

1k Views Asked by At

I'm using cpprestsdk for a Http client in my code as given below:

std::string MyClass::GetPage(std::string url)
{
    web::http::client::http_client httpClient(utility::conversions::to_string_t(url));
    pplx::task<web::http::http_response> request = httpClient.request(web::http::methods::GET);
    request.then([=](pplx::task<web::http::http_response> task)
    {
        // TODO: handle exceptions here.
        web::http::http_response  response = task.get();
        return response.extract_string();
    });
}

I'm getting this strange set of compiler errors stated in the question header for multiple files. One example reference the error is point to is in http_client.h:

const utf16string &content_type = ::utility::conversions::to_utf16string("text/plain"),

in which there's nothing before the ::utility. This happens in multiple places and it's not my code. This is straight from SDK. I downloaded the API using NuGet package manager. Help please. Thanks.

0

There are 0 best solutions below