Right. Well take out all the pw::'s. They aren't necessary. You have CURLcode already. Just assign the of curl_easy_perform to result.
Code:
int pw::exec()
{
// Set URL
curl_easy_setopt(curl, CURLOPT_URL, &target);
std::cout << "1\n"; //code crashes after this point
// Attempt to retrieve the remote page
result = curl_easy_perform(curl); // i believe it crashes here. I can't seem to access the curl object anyhow.
std::cout << "2\n"; //code crashes before this point
// Did we succeed?
if (result == CURLE_OK)
{
std::cout << buffer;
}
else
{
std::cout << "Error: [" << result << "] - " << errorBuffer;
}
}
Also, you should cleanup in the destrutor.