DISCLAIMER: Yes, I do know that there is one that has the exact the program as me
link to that post HERE
I coincidentally have the exact same issue. However, I don’t know how to implement its answer into my code. Could someone give me an example code to it?
The suggestion is to change the following to link -lurlmon.lib
option as #pragma comment(lib, "urlmon.lib")
works only for MSVC
Is it as simple as replacing
#pragma comment(lib, "urlmon.lib")
to
#pragma comment(lib, "lurlmon.lib")
?
If so, then the solution doesn’t quite work.
I am using MinGW gcc compiler
My code is simply:
if (S_OK == URLDownloadToFileA(NULL, link, destination, 0, NULL)){
cout << "Successed in downloading file no. " << count << endl;
}
else {
cout << "Failed in downloading file no. " << count << endl;
}
where link, destination are all in const char*
variable type
and count
is just the file count (yes, the entire thing is in a for
loop)