Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Network include error  (Read 24132 times)

0 Members and 1 Guest are viewing this topic.

NILS1990

  • Newbie
  • *
  • Posts: 2
    • View Profile
Network include error
« on: August 10, 2008, 05:17:54 pm »
Hi
First of all I'm new here and I think the project is fantastic  :wink:

So and now my problem:

I want to code a Client/Server based login-system for a multiplayer game.
But if I include windows.h and SFML/Network.hpp there are a cuple of mistakes:


Code: [Select]

112 C:\Programme\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h [Error C2011] 'fd_set': 'struct' Typneudefinition
156 C:\Programme\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h [Error C2011] 'timeval': 'struct' Typneudefinition

and so on

Oh my IDE is german in english "Typneudefinition" is Typenewdefinition I think.

now my Code:

Code: [Select]

#include <iostream>
#include <windows.h>
#include <mysql.h>
#include <string>
#include <SFML/Network.hpp>

using namespace std;

class CLoginSystem
{
    private:
        MYSQL *my;

    public:
        CLoginSystem();
        ~CLoginSystem();
        bool CheckPassword(string username, string password);

};



I hope you can help me and sorry for my bad english. I'm german ;)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Network include error
« Reply #1 on: August 11, 2008, 02:55:40 am »
What if you include SFML headers first ?

And anyway, why would you have to include windows.h if you're using SFML ?
Laurent Gomila - SFML developer

NILS1990

  • Newbie
  • *
  • Posts: 2
    • View Profile
Network include error
« Reply #2 on: August 11, 2008, 05:56:56 pm »
yeah thank you! I tried it about 1 hour xD

I first used windows.h because of the mysql-connection, but now I realized that this isn't necessary because of the SFML-includes.