I'm a Java programmer forced to do some C++. What a nightmare! I'm trying to send a POST request to a web service like this:
#include <Windows.h>
#include <tchar.h>
#include <WinInet.h>
static TCHAR hdrs[] = _T("Content-Type: application/x-www-form-urlencoded");
static TCHAR frmdata[] = _T("id=01&message=test_message");
static LPCSTR accept[2] = { "*/*", NULL };
static LPCWSTR tag = L"MyAgent";
static LPCWSTR requestType = L"POST";
// for clarity, error-checking has been removed
HINTERNET hSession = InternetOpen(tag, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
HINTERNET hConnect = InternetConnect(hSession, _T("desktop-60nl2pl:9998"), INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 1);
HINTERNET hRequest = HttpOpenRequest(hConnect, requestType, _T("/GUser/login"), NULL, NULL, (LPCWSTR*)accept, 0, 1);
HttpSendRequest(hRequest, hdrs, strlen((char*)hdrs), frmdata, strlen((char*)frmdata));
That code is based on this posting: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/dc74e7bf-3ac9-41a0-b1c7-ece14a76a906/send-post-request-to-simple-php-page-using-wininet?forum=vcgeneral
It compiles but doesn't link. Getting a bunch of these "unresolved external symbol _imp_InternetOpenW referenced in function "class std::vector
Sorry if this is a newby question but I'm not able to understand all the gobbldygook I read about linker errors. Can someone explain in simple terms?