Can I use URLOpenBlockingStream on win32 console application ?
I have a simple code:
#include "stdafx.h"
#include <urlmon.h>
#include <iostream>
using namespace std;
bool url(){
LPCWSTR pfile(NULL);
HRESULT hRez = URLDownloadToFile( NULL, _T("www.google.com"), (pfile), 0, NULL );
if( hRez == 0 ){
return 1;
// download ok
}
else{
return 0;// download failed
}
}
int _tmain(int argc, _TCHAR* argv[])
{
cout<< url();
return 0;
}
and it returns compiler error
All outputs are up-to-date.
1>vvconsole.obj : error LNK2019: unresolved external symbol _URLDownloadToFileW@20 referenced in function "bool __cdecl url(void)" (?url@@YA_NXZ)
1>C:\Users\Prem kumar Sekaran\Documents\Visual Studio 2010\Projects\vvconsole\Debug\vvconsole.exe : fatal error LNK1120: 1 unresolved externals
1>Build FAILED.
I am using built in libraries, Do I still need to link the .lib file ?