sf::VertexArray lines(sf::LinesStrip, m_Verts.size()+1);
std::vector<sf::Vector2<float> >::const_iterator it = m_Verts.begin();
for(;it!=m_Verts.end();++it) {
lines.append(sf::Vertex(*it, sf::Color(255,255,255,255)));
}
lines.append(sf::Vertex(m_Verts[0], sf::Color(255,255,255,255)));
target.draw(lines);
and m_Verts is fed like this
m_Verts.push_back(sf::Vector2f(10,10));
m_Verts.push_back(sf::Vector2f(110,10));
m_Verts.push_back(sf::Vector2f(110,110));
m_Verts.push_back(sf::Vector2f(10,110));
This example out of context may seem like a detour though ;)
Read this:
http://en.sfml-dev.org/forums/index.php?topic=5559.0
sf::VertexArray lines(sf::LinesStrip, m_Verts.size()+1);
This assings m_Verts.size()+1 default constructed vertices(white, located at 0.0) to this vertexarray. Remove second parameter and it'll be fine.