Link Error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • yaniv1234567890

    Link Error

    write the next small program using wininet:

    #define _UNICODE
    #include <windows.h>
    #include <wininet.h>
    #include <TCHAR.H>

    void main()
    {
    HINTERNET iOpen;
    LPCWSTR lpName = __T("Eyal Computers Inc");
    LPCWSTR lpEmpty = __T(" ");
    iOpen=
    InternetOpenW(l pName,INTERNET_ OPEN_TYPE_PRECO NFIG,lpEmpty,lp Empty,0);

    }


    but i get a link error :
    "XmlPost error LNK2019: unresolved external symbol __imp__Internet OpenW@20
    referenced in function _main"

    im using VC.net in win32 project.
    what do i need to do to fix that problem ?
    10x for any help.


  • Victor Bazarov

    #2
    Re: Link Error

    yaniv1234567890 wrote:[color=blue]
    > write the next small program using wininet:
    >
    > #define _UNICODE
    > #include <windows.h>
    > [..snip..]
    >
    > but i get a link error :
    > "XmlPost error LNK2019: unresolved external symbol __imp__Internet OpenW@20
    > referenced in function _main"
    >
    > im using VC.net in win32 project.
    > what do i need to do to fix that problem ?[/color]

    Ask in a Windows programming newsgroup. Your problem cannot be solved
    in terms of C++ _language_. It's more likely a project setting problem.
    You must be missing a library in your link command line. Which library
    I don't know, and that's is beyond the scope of this newsgroup anyway.

    Victor

    Comment

    • Pete Chapman

      #3
      Re: Link Error

      yaniv1234567890 wrote:
      [color=blue]
      > write the next small program using wininet:
      >
      > #define _UNICODE
      > #include <windows.h>
      > #include <wininet.h>
      > #include <TCHAR.H>
      >
      > void main()
      > {
      > HINTERNET iOpen;
      > LPCWSTR lpName = __T("Eyal Computers Inc");
      > LPCWSTR lpEmpty = __T(" ");
      > iOpen=
      > InternetOpenW(l pName,INTERNET_ OPEN_TYPE_PRECO NFIG,lpEmpty,lp Empty,0);
      >
      > }
      >
      >
      > but i get a link error :
      > "XmlPost error LNK2019: unresolved external symbol __imp__Internet OpenW@20
      > referenced in function _main"
      >
      > im using VC.net in win32 project.
      > what do i need to do to fix that problem ?
      > 10x for any help.
      >
      >[/color]


      This is off-topic really. But off the top of my head I'd guess you need
      to add wininet.lib as a linker input in your project settings.

      Comment

      Working...