Sunday 15 January 2012

c++ - 'SDL_main' : must return a value -


I am trying to retrieve the contents of the websice in the ccess ++ usin SDL but this is giving me this error Is:

'SDL_main': a value must be returned

My code is:

  #include & lt ; Iostream & gt; #include "SDL.h" #include "SDL_net.h" #includes & lt; Cstring & gt; Int main (int argc, char ** argv) {SDL_Init (SDL_INIT_EVERYTHING); SDLNet_Init (); IP Address IP; SDLNet_ResolveHost (& amp; IP, "www.linux.org", 80); Const char * http = "GET / HTTP / 1.1 \ n Host: www.linux.org \ n \ n"; TCPsocket client = SDLNet_TCP_Open (& amp; ip); SDLNet_TCP_Send (customer, http, strlen (http) +1); Four lessons [10000]; While (SDLNet_TCP_Recv (Client, Text, 10000)) std :: cout & lt; & Lt; Text; SDLNet_TCP_Close (Customer); SDLNet_Quit (); SDL_Quit (); }   

When I put back 0; Lastly, this project was created but it ended immediately afterwards (I'm using vs. 2012)

UPDATE

  Cout   

Does not print anything, is it possible that I have configured my import incorrectly? Are they additional dependencies right?

SDL.lib; SDL_net.lib; SDLmain.lib

I do not know what else could be wrong ...

This is because SDL defines a macro like this:

  #define main SDL_main   

then the function that you write In fact, it is called SDL_main and like any other function that is not the actual main function, if it does not happen, return t zero , Give it a return statement Will.

No comments:

Post a Comment