#include #include #include "SDL/SDL.h" #include "SDL/SDL_net.h" using namespace std; int main(int argc, char* args[]) { IPaddress ip; if(SDL_Init(0)==-1) { cout << "SDL_Init:\n" << SDL_GetError(); exit(1); } if(SDLNet_Init()==-1) { cout << "erro\n" << SDLNet_GetError(); exit(2); } if (SDLNet_ResolveHost(&ip,NULL,16) ==-1) { cout << "Could not resolve host"; } else printf("LocalHost: %s\n",SDLNet_ResolveIP(&ip)); system("PAUSE"); // shutdown SDL_net SDLNet_Quit(); // shutdown SDL SDL_Quit(); return EXIT_SUCCESS; }