Witam!
Chcę napisać program, który ściąga plik tekstowy z serwera. Używam Code::Blocks. Tworzę nowy projekt, wchodzę w Project -> Build options -> zakładka Linker settings i tam w Link Libraries dodaję plik C:\Windows\system32\urlmon.dll
Kod:
#include <iostream>
#include <Urlmon.h>
using namespace std;
int main()
{
URLDownloadToFile( NULL, L"http://nazwa_serwera.pl/test.txt", L"C:\\test.txt", 0, NULL );
cout<<"OK";
return 0;
}
I dostaję błędy:
C:\Documents and Settings\Daniel\Pulpit\downloadziak\main.cpp|3|error: Urlmon.h: No such file or directory|
C:\Documents and Settings\Daniel\Pulpit\downloadziak\main.cpp||In function 'int main()':|
C:\Documents and Settings\Daniel\Pulpit\downloadziak\main.cpp|9|error: 'URLDownloadToFile' was not declared in this scope|
== Build finished: 2 errors, 0 warnings ===
Jak załączyć tę cholerną bibliotekę urlmon.lib? Skąd to w ogóle wziąć skoro Code::Blocks tego nie ma? Ręce mi opadają. Proszę o pomoc.
Pozdrawiam!
Daniel