title: cpp Socket, inheritage error
body: <p>Im creating a socket class that has a static member for creating different types of sockets (client and server). Here is the interface:</p>
  
  <pre><code>    class Socket{
      public:
          int sendData(std::string _data);
          std::string receiveData();
  
          int closeSocket();
  
      protected:      
          Socket();
          virtual int initializeSocket() = 0;
          virtual int connectSocket() = 0;
  
  
      public:     // static members: Factory, etc.
          static Socket* createClientSocket(std::string _ip, std::string _port);
          static Socket* createServerSocket(std::string _port);
  
      protected:  
          WSADATA mWsaData;
          SOCKET mSocket;
  
          addrinfo *mResult, mHints;
  </code></pre>
  
  <p>The children are:</p>
  
  <p>--> Server:</p>
  
  <pre><code>    class ServerSocket: public Socket{
      private:
          ServerSocket(const std::string _port);
          ~ServerSocket();
  
          int acceptClient();
  
      private:
          SOCKET mClientSocket;
  
          std::string mPort;
      };  //  class ServerSocket
  </code></pre>
  
  <p>--> Client:</p>
  
  <pre><code>    class ClientSocket: public Socket{
      private:
          ClientSocket(const std::string _ip, const std::string _port);
          ~ClientSocket();
  
      private:
          addrinfo *mPtr;
  
          std::string mServerIp, mServerPort;
      };  //  class ClientSocket
  </code></pre>
  
  <p>But while implementing initializeSocket and other members i get the error "inherited member is not allowed. As far as I concern, inherited classes can acces public and protected membes of the father class. Why this error arises?</p>
  
  <p>Thanks in advance :)</p>
  
  <p>EDIT:
  The error arises in many members, for example in the ServerSocket.cpp</p>
  
  <pre><code>int ServerSocket::initializeSocket(){  &lt;&lt;--- HERE in the name of the function appears 
      // Resolve the server address and port
      int iResult = getaddrinfo(NULL, mPort.c_str(), &amp;mHints, &amp;mResult);
      if ( iResult != 0 ) {
          printf("getaddrinfo failed with error: %d\n", iResult);
          WSACleanup();
          return 1;
      }
  
      //..... ETC....
  
      freeaddrinfo(mResult);
  
      iResult = listen(mSocket, SOMAXCONN);
      if (iResult == SOCKET_ERROR) {
          printf("listen failed with error: %d\n", WSAGetLastError());
          closesocket(mSocket);
          WSACleanup();
          return 1;
      }
      return 0;
     }
  </code></pre>
  
  <p>Where i wrote "&lt;&lt;-- HERE..."</p>
  
  <pre><code>1&gt;..\..\source\core\comm\ServerSocket.cpp(37): error C2509: 'initializeSocket' : member function not declared in 'BOViL::comm::ServerSocket'
  1&gt;          c:\programming\bovil\source\core\comm\ServerSocket.h(18) : see declaration of 'BOViL::comm::ServerSocket'
  </code></pre>