title: No matching constructor for initialization of "Type"
body: <p>I am writing a board game using C++ (with SFML2.2 library, Xcode 6.1.1). I created two classes: block and board. The idea is to create a 4x4 vector of blocks inside board. The codes are below:</p>
  
  <p>In block.h</p>
  
  <pre><code>#ifndef __Game1024__block__
  #define __Game1024__block__
  #include &lt;stdio.h&gt;
  #include &lt;iostream&gt; 
  #endif /* defined(__Game1024__block__) */
  
  using namespace std;
  
  class block{
  public:
      sf::RectangleShape rect;
      sf::Text text;
      block();
      block(const int X,const int Y,const double size, const double blockSize, const double charSize, const int value, const sf::Color fillColor, const sf::Color textColor);
  };
  </code></pre>
  
  <p>In block.cpp</p>
  
  <pre><code>#include &lt;SFML/Audio.hpp&gt;
  #include &lt;SFML/Graphics.hpp&gt;
  #include &lt;string&gt;
  #include &lt;sstream&gt;
  #include "block.h"
  
  using namespace std;
  
  block::block(){}
  
  block::block(const int X,const int Y,const double size, const double blockSize, const double charSize, const int value, const sf::Color fillColor, const sf::Color textColor){
  
      double centerX = (X+0.5)*size;
      double centerY = (Y+0.5)*size;
      stringstream ss;
      ss &lt;&lt; value;
      string sval = ss.str();
  
      rect.setSize(sf::Vector2f(blockSize,blockSize));
      rect.setOrigin(blockSize/2.0, blockSize/2.0);
      rect.setPosition(centerX, centerY);
      rect.setFillColor(fillColor);
  
      text.setStyle(sf::Text::Bold);
      text.setCharacterSize(charSize);
      text.setString(sval);
      text.setColor(textColor);
      text.setOrigin(text.getLocalBounds().width/2.0, text.getLocalBounds().height);
      text.setPosition(centerX, centerY);
   }
  </code></pre>
  
  <p>In board.h</p>
  
  <pre><code>#ifndef __Game1024__board__
  #define __Game1024__board__
  #include &lt;stdio.h&gt;
  #endif /* defined(__Game1024__board__) */
  #include &lt;vector&gt;
  #include "block.h"
  using namespace std;
  
  class board{
  private:
      int winSizeX;
      int winSizeY;
      int margin;
      double charSize;
  public:
      vector&lt;vector&lt;block&gt;&gt; matrix;
      board();
      board(int winSizeX_,int winSizeY_,int margin_, double charSize_);
      void draw();
  };
  </code></pre>
  
  <p>And in board.cpp</p>
  
  <pre><code>#include "board.h"
  //#include &lt;SFML/Audio.hpp&gt;
  #include &lt;SFML/Graphics.hpp&gt;
  #include "block.h"
  using namespace std;
  
  board::board(){}
  
  board::board(int winSizeX_,int winSizeY_,int margin_, double charSize_){
      winSizeX = winSizeX_;
      winSizeY = winSizeY_;
      margin = margin_;
      charSize = charSize_;
      matrix = vector&lt;vector&lt;block&gt;&gt;(4,vector&lt;block&gt;(4));
  
      double size = winSizeX/4.0; // = 256
      double blockSize = size - 2*margin;
      const sf::Color fillColor = sf::Color::Red;
      const sf::Color textColor = sf::Color::White;
  
      sf::Font font;
      if(!font.loadFromFile("./sansation.ttf")){
          exit(EXIT_FAILURE);
      };
      for (int i = 0; i &lt; 4; ++i){
          for (int j = 0; j &lt; 4; ++j){
              int value = 4*j + i + 1;
              matrix[i][j] = block(i,j,size,blockSize, charSize,value,fillColor,textColor);
              matrix[i][j].text.setFont(font);
              matrix[i][j].text.setOrigin(matrix[i][j].text.getLocalBounds().width/2.0,b[i][j].text.getLocalBounds().height);
          }
      }
  }
  </code></pre>
  
  <p>The error comes from <strong>board.cpp</strong></p>
  
  <pre><code>matrix[i][j] = block(i,j,size,blockSize, charSize,value,fillColor,textColor);
  </code></pre>
  
  <p>One weird thing is when I typed matrix[i][j] = block, the autofill of my IDE (Xcode) will generate</p>
  
  <pre><code>matrix[i][j] = block(&lt;#const int X#&gt;, &lt;#const int Y#&gt;, &lt;#const double size#&gt;, &lt;#const double blockSize#&gt;, &lt;#const double charSize#&gt;, &lt;#const int value#&gt;, &lt;#const int fillColor#&gt;, &lt;#const int textColor#&gt;)
  </code></pre>
  
  <p>The last two arguments of constructor <strong>block</strong> are changed from type <strong>sf::Color</strong> into <strong>int</strong>. </p>
  
  <p>If I create a 4x4 vector of blocks in the <strong>main.cpp</strong> file and call the constructor of <strong>block</strong>, there is no error...</p>
  
  <p>Any help? 
  Thanks in advance! </p>
  
  <p>[Update] I attached the scrrenshot of the error message
  <img src="https://i.stack.imgur.com/T4If7.png" alt="enter image description here"></p>