0
I’m having a problem compiling a code in visual studio 2017 with SFML libraries, when I try to compile it gives the following error:
INTERNAL COMPILER ERROR in 'C: Program Files (x86) Microsoft Visual Studio 2017 Community VC Tools MSVC 14.10.25017 bin Hostx86 x86 CL.exe' Choose the Technical Support command from the Visual C++ Help menu, or open the Technical Support help file for more information C: Program Files (x86) Microsoft Visual Studio 2017 Community Common7 IDE VC Vctargets Microsoft.CppCommon.targets(358,5): error MSB6006: "CL.exe" ended with code 2.
Does anyone know what I can do to fix?
Edit: Here is the code that is generating error:
include <SFML\Graphics.hpp>
int main() {
sf::RenderWindow window(sf::VideoMode(640, 480), "Bouncing Mushroom");
//Criando Textura
sf::Texture mushroomTexture;
mushroomTexture.loadFromFile("mushroom.png");
sf::Sprite mushroom(mushroomTexture);
sf::Vector2u size = mushroomTexture.getSize;
mushroom.setOrigin(size.x / 2, size.y / 2);
sf::Vector2f increment(0.4f, 0.4f);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
if ((mushroom.getPosition().x + (size.x / 2) > window.getSize().x && increment.x > 0) || (mushroom.getPosition().x - (size.x / 2) < 0 && increment.x < 0))
{
// Reverse the direction on X axis.
increment.x = -increment.x;
}
if ((mushroom.getPosition().y + (size.y / 2) > window.getSize().y && increment.y > 0) || (mushroom.getPosition().y - (size.y / 2) < 0 && increment.y < 0))
{
// Reverse the direction on Y axis.
increment.y = -increment.y;
}
mushroom.setPosition(mushroom.getPosition() + increment);
window.clear(sf::Color(16, 16, 16, 255)); // Dark gray.
window.draw(mushroom); // Drawing our sprite.
window.display();
}
return 0;
}