Solved

what does mean this error?

Posted on 2008-10-02
3
1,748 Views
Last Modified: 2012-05-05
Hello Experts,
i got this error while i was compiling with Dev C++
what does it mean??
void main(int argc, char **argv)
 
{
      WORD wVersionRequested = MAKEWORD(1,1);
      WSADATA wsaData;
      int nRet;
 
    
 
      if (argc != 3)
      {
            fprintf(stderr,
                  "\nSyntax: GetHTTP ServerName FullPathName\n");
            return 0;
      }
 
      //
      // Initialize WinSock.dll
      //
      nRet = WSAStartup(wVersionRequested, &wsaData);
      if (nRet)
      {
            fprintf(stderr,"\nWSAStartup(): %d\n", nRet);
            WSACleanup();
            return 0;
      }
      
      if (wsaData.wVersion != wVersionRequested)
      {
            fprintf(stderr,"\nWinSock version not supported\n");
            WSACleanup();
            return 0;
      }
 
      _setmode(_fileno(stdout), _O_BINARY);
 
      
      GetHTTP(argv[1], argv[2]);
 
      WSACleanup();
}

Open in new window

0
Comment
Question by:kagami01
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 53

Accepted Solution

by:
Infinity08 earned 130 total points
ID: 22622772
Exactly what it says : that main has to return an int (not void).

So :

        int main(int argc, char **argv)

instead of :

        void main(int argc, char **argv)

0
 

Author Comment

by:kagami01
ID: 22622821
great!thank you
0
 
LVL 17

Expert Comment

by:CSecurity
ID: 22622843
if you link winsock.dll to my code, will compile without error
Regards
#include <iostream.h>
#include <windows.h>
 
int main(int argc, char **argv)
 
{
      WORD wVersionRequested = MAKEWORD(1,1);
      WSADATA wsaData;
      int nRet;
 
    
 
      if (argc != 3)
      {
            fprintf(stderr,
                  "\nSyntax: GetHTTP ServerName FullPathName\n");
            return 0;
      }
 
      //
      // Initialize WinSock.dll
      //
      nRet = WSAStartup(wVersionRequested, &wsaData);
      if (nRet)
      {
            fprintf(stderr,"\nWSAStartup(): %d\n", nRet);
            WSACleanup();
            return 0;
      }
      
      if (wsaData.wVersion != wVersionRequested)
      {
            fprintf(stderr,"\nWinSock version not supported\n");
            WSACleanup();
            return 0;
      }
      return 0;
}

Open in new window

0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to implement Singleton Design Pattern in Java.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question