title: ' was not declared in this scope' C++
body: <p>I have some rude errors... I search the web about it, and i was able to read her everywhere, but still not fix my problem ...</p>
  
  <p>Here is my <strong>main</strong> :</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "SFML/Network.hpp"
  #include "decode.hpp"
  #include "listOfFunction.hpp"
  #include "map.hpp"
  
  void createSocket(){
      unsigned short bindPort = 12800;
      unsigned short clientPort;
      int ret = 0;
      sf::UdpSocket socket;
      sf::IpAddress clientAddr;
      sf::Packet packet;
      Map mainMap;
  
      if (socket.bind(bindPort) != sf::Socket::Done){
          if (sf::Socket::Error) std::cout &lt;&lt; "An unexpected error happened : Fatal Error !" &lt;&lt; std::endl;
          if (sf::Socket::NotReady) std::cout &lt;&lt; "The socket is not ready to send/receive data yet !" &lt;&lt; std::endl;
      }
  
      while(1){
          packet.clear();
          socket.receive(packet, clientAddr, clientPort);
          std::string header = readFromPacket(packet);
          ret = callFunction(packet, header, clientAddr, clientPort, mainMap, socket);
      }
  }
  
  int main(){
      createSocket();
  }
  </code></pre>
  
  <p>Here are the errors :</p>
  
  <blockquote>
    <p>error : 'Map' was not declared in this scope 
    error : expected ';'before 'mainMap' 
    error : 'mainMap' was not declared in this scope
    error : callFunction was not declared in this scope</p>
  </blockquote>
  
  <p><strong>Map.cpp :</strong></p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  #include "SFML/Network.hpp"
  #include "map.hpp"
  
  Map::Map(){
      char number[5] = "\0";
      int m_obstacle[80000] = {0};
      std::string m_error = "not error";
      std::vector &lt;int&gt; m_posPlayer(0);
      std::vector &lt;std::string&gt; m_namePlayer(0);
      std::vector &lt;sf::IpAddress&gt; m_addressPlayer(0);
      std::string m_stringObstacle = "";
      for (int i=0;i&lt;80000;i++){
          sprintf(number, "%d", m_obstacle[i]);
          m_stringObstacle += std::string(number) + "+";
      }
  }
  
  int Map::sendMap(sf::IpAddress address, unsigned short clientPort, sf::UdpSocket&amp; socket){
      std::string header = "rcv_map";
      sf::Packet packet;
      packet &gt;&gt; header &gt;&gt; m_stringObstacle;
      if(socket.send(packet, address, clientPort)!=sf::UdpSocket::Done){
          m_error += "Error sending the packet \n";
      }
      return 0;
  }
  
  int Map::error(){
      if (m_error != "not_error"){
          std::cout &lt;&lt; "here is a following list of errors : " &lt;&lt; m_error &lt;&lt; std::endl;
      }
      m_error.erase(0,m_error.length());
  }
  </code></pre>
  
  <p><strong>Map.hpp:</strong></p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "SFML/Network.hpp"
  
  #ifndef DECODE_H_INCLUDED
  #define DECODE_H_INCLUDED
  
  class Map{
  
      public:
          Map();
          int sendMap(sf::IpAddress address, unsigned short clientPort, sf::UdpSocket&amp; socket);
          int error();
  
      private:
          int m_obstacle;
          std::vector &lt;int&gt; m_posPlayer;
          std::vector &lt;int&gt; m_namePlayer;
          std::vector &lt;sf::IpAddress&gt; m_addressPlayer;
          std::string m_stringObstacle;
  };
  
  #endif // DECODE_H_INCLUDED
  </code></pre>
  
  <p>The problem probably exists in the headers, but I can't figure it out.</p>