Connecting Tech Pros Worldwide Forums | Help | Site Map

Link Error

yaniv1234567890
Guest
 
Posts: n/a
#1: Jul 22 '05
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(lpName,INTERNET_OPEN_TYPE_PRECONFIG, lpEmpty,lpEmpty,0);

}


but i get a link error :
"XmlPost error LNK2019: unresolved external symbol __imp__InternetOpenW@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
Guest
 
Posts: n/a
#2: Jul 22 '05

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__InternetOpenW@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
Pete Chapman
Guest
 
Posts: n/a
#3: Jul 22 '05

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(lpName,INTERNET_OPEN_TYPE_PRECONFIG, lpEmpty,lpEmpty,0);
>
> }
>
>
> but i get a link error :
> "XmlPost error LNK2019: unresolved external symbol __imp__InternetOpenW@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.
Closed Thread