Winsock Client + my game = problem
I made client using winsock (copy - paste it from MSDN), and also I made a server.
I compiled Server and Client, and they work fine, then i wanted to copy code of client into the code of my game. So when i start game it send message to the server, like client did that alone, without code of my game.
And now there are a lot of errors and warnings (Errors:104, Warnings:24)
In my game I use this libraries:
Code:
#include <allegro.h>
#include <winalleg.h>
#include <iostream>
#include <fstream>
#include <conio.h>
#include <stdio.h>
#ifndef _USE_OLD_OSTREAMS
using namespace std;
#endif
#include "guicon.h"
#include "grafika.h"
#include <crtdbg.h>
#define WINDOW_X 628
#define WINDOW_Y 376 //511
#define EXIT_X 200 //572
#define EXIT_Y 200 // 486
#define MAX_CHARACTERS 17
#pragma comment(lib, "alleg.lib")
and when i put into this:
Code:
#define WIN32_LEAN_AND_MEAN
#include <winsock2.h>
#include <ws2tcpip.h>
#include <stdlib.h>
#include <stdio.h>
// Need to link with Ws2_32.lib, Mswsock.lib, and Advapi32.lib
#pragma comment (lib, "Ws2_32.lib")
#pragma comment (lib, "Mswsock.lib")
#pragma comment (lib, "AdvApi32.lib")
#define DEFAULT_BUFLEN 512
#define DEFAULT_PORT "27015"
It says this: (Look the attachment file)
What is a problem :/ it is says that ws2tcpip is problem, but this works if there is no code of my game.... It works fine then. When i merge this to codes, i get a lot of errors ://////// HELP please..
Thanks.