-2

Im currently trying to install a simple file. but the current problem is that i am unable to get a LPCSTR out of my string here is my code:

string curDir;
    stringstream ss;
    ss << szCurDir;
    ss >> curDir;

    string url = "https://test.com";
    string filePath = (curDir + "\\Content\\") + "manifest.txt";

    URLDownloadToFile(NULL,url.c_str(), filePath.c_str(),0, NULL);

The errors im getting is

1>MainForm.obj : error LNK2028: unresolved token (0A000591) "extern "C" long __stdcall URLDownloadToFileA(struct IUnknown *,char const *,char const *,unsigned long,struct IBindStatusCallback *)" (?URLDownloadToFileA@@$$J220YGJPAUIUnknown@@PBD1KPAUIBindStatusCallback@@@Z) referenced in function "private: void __clrcall SchoolWork::MainForm::UpdateButton_Click(class System::Object ^,class System::EventArgs ^)" (?UpdateButton_Click@MainForm@SchoolWork@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z) 1>MainForm.obj : error LNK2019: unresolved external symbol "extern "C" long __stdcall URLDownloadToFileA(struct IUnknown *,char const *,char const *,unsigned long,struct IBindStatusCallback *)" (?URLDownloadToFileA@@$$J220YGJPAUIUnknown@@PBD1KPAUIBindStatusCallback@@@Z) referenced in function "private: void __clrcall SchoolWork::MainForm::UpdateButton_Click(class System::Object ^,class System::EventArgs ^)" (?UpdateButton_Click@MainForm@SchoolWork@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)

John Doe
  • 47
  • 7
  • 1
    Possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – user0042 Sep 19 '17 at 16:46

1 Answers1

0

found my solution for those who have the same issue my LNK issue was that i forgot to add urlmon.lib as dependecy. where Urltodownload comes from.

John Doe
  • 47
  • 7