I am new to C++ and I can’t understande what is wrong with my code I am using code block for my project and I don’t even know how I can see the erroe message. So I know what is wrong but I dont know why as all the files are normaly set up. This part of the code is just supose to make a chesboard like background. It tells me there is an error at the line 11 sf::RectangleShape rect(sf::Vector2f(600 / size, 600 / size));
#include <iostream>
#include <vector>
#include <cmath>
#include <SFML/Graphics.hpp>
int size = 8;
bool loop = true;
sf::RenderWindow window(sf::VideoMode(600, 600), "Echec Dames");
void drawBoard(int size) {
sf::RectangleShape rect(sf::Vector2f(600 / size, 600 / size));
bool colorSwitch = false;
for (int n = 0; n < size; ++n) {
for (int r = 0; r < size; ++r) {
rect.setPosition(n * 600 / size, r * 600 / size);
rect.setFillColor(colorSwitch ? sf::Color::White : sf::Color::Black);
window.draw(rect);
colorSwitch = !colorSwitch;
}
if (size % 2 == 0) {
colorSwitch = !colorSwitch;
}
}
}
I tried looking up the syntax but I couldn’t finc any mistakes. Same with the modules or library (I don’t know how it is called). I at least expected to has an errore message but I can’t figure out how to see them.
2