Bueno ya probaré yo un día de estos en Codeblocks cuando virtualice un Windows. En cuanto a esos errores, pues haz lo que te comenta el compilador, agrega stdafx.h y como los LPWSTR son typedef's de wchar_t * pues lo pones como un arreglo de LPWSTR:
Código: cpp
#include <windows.h>
#include <stdafx.h>
#include <urlmon.h>
#include <cstdio>
int main(void)
{
HRESULT hr;
LPCWSTR url[] = "http://www.cualquierweb.com/lib.txt";
LPCWSTR local[] = "C:\\rirTemp\\Readme.txt";
hr = URLDownloadToFile(NULL, url, local, 0, NULL);
if (hr == S_OK)
{
puts("Download OK");
return EXIT_SUCCESS;
}
else
{
puts("There was an error");
return EXIT_FAILURE;
}
}