Note that there are some explanatory texts on larger screens.

plurals
  1. POUnsolved error when using WinInet.h (... error LNK2019: unresolved external symbol _WinMain@16....)
    primarykey
    data
    text
    <p>I'm a beginner to programming. I keep getting this error as I run my program. I have already checked online and many people suggest to add /* #pragma comment(lib, "wininet.lib") */ after all the includes, or to change property setting. <br> I changed both so far, but the message is still there. <br> I'm using 2010 Microsoft Visual Studio and the entire error message is below:</p> <blockquote> <p>1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol <em>WinMain@16 referenced >in function _</em>_tmainCRTStartup<br> 1>C:\Users\Username\Desktop\Winlnet test\Debug\Winlnet test.exe : fatal error LNK1120: 1 >unresolved externals<br> 1><br> 1>Build FAILED.<br> 1></p> </blockquote> <p>any help is greatly appreciated!! below is the program.</p> <pre><code>#include &lt;string&gt; #include &lt;iostream&gt; #include &lt;fstream&gt; #include &lt;windows.h&gt; #include &lt;wininet.h&gt; #include &lt;winsock.h&gt; #include &lt;stdio.h&gt; #include &lt;stdarg.h&gt; #pragma comment(lib, "wininet.lib") using namespace std; int main() { HINTERNET hOpen, hURL; LPCWSTR NameProgram = L"Webreader"; // LPCWSTR == Long Pointer to Const Wide String LPCWSTR Website; char file[101]; unsigned long read; //Always need to establish the internet connection with this funcion. if ( !(hOpen = InternetOpen(NameProgram, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0 ))) { cerr &lt;&lt; "Error in opening internet" &lt;&lt; endl; return 0; } Website = L"http://www.google.com"; hURL = InternetOpenUrl( hOpen, Website, NULL, 0, 0, 0 ); //Need to open the URL InternetReadFile(hURL, file, 100, &amp;read); while (read == 100) { InternetReadFile(hURL, file, 100, &amp;read); file[read] = '\0'; cout &lt;&lt; file; } cout &lt;&lt; endl; InternetCloseHandle(hURL); return 0; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload