so im trying to download a file from a url link using URLDownloadToFile, and that needs the urlmon when i include urlmon.h and the urlmon.lib it cant find the headers. I am using visual studio code, anyone know how could i get the header and the library?
Asked
Active
Viewed 310 times
0
-
You probably have to edit your tasks.json – drescherjm Nov 30 '21 at 14:45
-
ok how do i do that and what i add in it? – stephan Nov 30 '21 at 14:47
-
The msdn documentation says you have to link to `urlmon.lib` [https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/ms775123(v=vs.85)](https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/ms775123(v=vs.85)) – drescherjm Nov 30 '21 at 14:47
-
How you link depends on what compiler you selected. For gcc its probably adding `"-lurlmon,"` to your compilers args: – drescherjm Nov 30 '21 at 14:48
-
This question has examples on how to link to libraries with VSCode: [https://stackoverflow.com/questions/52910102/vscode-c-task-json-include-path-and-libraries](https://stackoverflow.com/questions/52910102/vscode-c-task-json-include-path-and-libraries) – drescherjm Nov 30 '21 at 14:58
-
I am using a extension and not the built in visual studio code c++ build and debug. i added the compiler flag -lurlmon and ran with it but i am still getting errors that URLdownloadfile is undefined – stephan Nov 30 '21 at 15:06
-
Are you talking about the code-runner extension? I don't use that. There is a tag for that you can add to your question. – drescherjm Nov 30 '21 at 15:12
-
no, i use compile & run. You can edit the flags and i added that flag but i still get the same error – stephan Nov 30 '21 at 15:16