Hello guys,
im using this function :

//All Includes of my project
#include <windows.h>
#include <iostream> 
#include <fstream>
#include <string>
#include <direct.h>
#include <urlmon.h>  

if (!File::Exists("c:\\MySettings\\Items.txt"))
    {
       URLDownloadToFile(NULL, ("http://download1225.mediafire.com/x6i9klhsm3dg/q6z21pgg9t5t6dn/Items.txt"), ("C:\\MySettings\\Items.txt"), 0, 0);
	}

And i get a compiling error :
Unresolved external symbol ""extern "C" long __stdcall URLDownloadToFileA(struct IUnknown *,char const *,char const *,unsigned long,struct IBindStatusCallback *)" (?URLDownloadToFileA@@$$J220YGJPAUIUnknown@@PBD1KPAUIBindStatusCallback@@@Z)".

I have really no idea what im doing wrong.
(Im using Visual Studio 2008)
Help is appreciated :)

Recommended Answers

All 5 Replies

That's a linker error, actually. Have you pointed VC++ to the right library directory and listed out the .lib files you want it to link to? (all this under Project/Properties/CC++/Linker (inputs and general)

That's a linker error, actually. Have you pointed VC++ to the right library directory and listed out the .lib files you want it to link to? (all this under Project/Properties/CC++/Linker (inputs and general)

Uhm, How do i check if i "pointed VC++ to the right library directory and listed out the .lib files you want it to link to?" ?

Sure, make me open the darn program. Just kidding.

This is what I was trying to remember in the last post:

Go to Project
<Your Projname>Properties
Configuration Properties
Linker
General
Additional Library Directories -- add them in (where are the lib files? - can be more than one directory

Then, still under Linker

Input
Additional Dependencies -- add in "mylibrary.lib, mylibrary2.lib"

I'm assuming you already put in your include directories under

Configuration Properties
C/C++
General
Additional Include Directories.

Well, the only thing i got working was

Input
      Additional Dependencies -- add in "mylibrary.lib, mylibrary2.lib"

But that caused errors =/

Is there any other function like "URLDownloadToFile" ?

Sorry for double posting but i can't find the "Edit Button" in my post.

This sloved my error :

#include <urlmon.h>    
#pragma comment(lib, "Urlmon")
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.