@janszySomething is wrong in your code: you are using the fill constructor of std::vector and also push_back sprites.
This line
std::vector<sf::Sprite> stars(numStars);
creates a vector of
numStars sprites, so there is no need to push back the sprites. Access sprites with
stars[index].
By the way, the fill constructor can initialize the sprites with a copy of a given sprite.
What your code could be:
sf::Texture gwiazda;
gwiazda.loadFromFile("gwiazda.png");
int numStars = 5;
std::vector<sf::Sprite> stars(numStars, sf::Sprite(gwiazda));
for(int i=0; i < numStars; ++i)
stars[i].setPosition(150,i*100);