F
Furtano
Gast
Hi,
warum wird mir in Zeile 30 folgender Fehler angezeigt?
Versteh ich nicht
.
Error 2 error C2440: 'initializing' : cannot convert from 'void' to 'sf::RectangleShape' c:\users\christian\desktop\uni\8_semester\code\sdl1\sdl1\ameise.cpp 31
LG und vielen Dank,
Furtano
warum wird mir in Zeile 30 folgender Fehler angezeigt?
Versteh ich nicht

Error 2 error C2440: 'initializing' : cannot convert from 'void' to 'sf::RectangleShape' c:\users\christian\desktop\uni\8_semester\code\sdl1\sdl1\ameise.cpp 31
LG und vielen Dank,
Furtano
PHP:
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <cstdlib>
#include <iostream>
#include <Windows.h>
#include "Globals.h"
#include "Lanton.h"
using namespace std;
int main (){
sf::RenderWindow window(sf::VideoMode(600, 600), "My window");
float i = 0;
bool timeOver = false;
bool langtonField[SIZE][SIZE];
std::vector <sf::RectangleShape> gridhey;
int spaceCounter = 0;
sf::Clock clock;
// 1000 Quadrate anlegen
int rectangleSize = 600/SIZE;
for (int y = 0; y < 600; y = y+= rectangleSize){
for (int x = 0; x < 600; x += rectangleSize){
sf::RectangleShape shape(sf::Vector2f(rectangleSize ,rectangleSize));
shape.setFillColor(sf::Color(255,255,255));
shape.setPosition((float)x, (float)y);
shape.setOutlineThickness(1);
shape.setOutlineColor(sf::Color(0,0,0));
gridhey.push_back(shape);
sf::RectangleShape bla = gridhey.pop_back();
}
}
}