I am trying to learn SFML but it keeps giving me two error messages:
Error LNK2001 unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B) SFML_HELLO_WORLD C:\Users\brayd\Documents\Coding\Application_Projects\SFML_HELLO_WORLD\SFML_HELLO_WORLD\SFML_HELLO_WORLD.obj 1
and
Error LNK2001 unresolved external symbol "public: static class sf::Color const sf::Color::Blue" (?Blue@Color@sf@@2V12@B) SFML_HELLO_WORLD C:\Users\brayd\Documents\Coding\Application_Projects\SFML_HELLO_WORLD\SFML_HELLO_WORLD\SFML_HELLO_WORLD.obj 1
here is my code:
#include <SFML/Graphics.hpp>
#include <iostream>
// SFML installation
// Make sure SFML is 32-bit version
// Go to Project > (Name) Properties > C/C++ > Additional Include Directories.
// Add C:\SFML-#.#.#
// Go to Linker and add SFML\lib to Additional Include Libraries
// Go to Linker > Input and add the required .lib files (sfml-graphics.lib, sfml-window.lib, sfml-system.lib, etc.)
// Go to C/C++ > Preprocessor > Preprocessor Definitions and add SFML_STATIC
// Add all files from SFML\bin to project folder
int main()
{
sf::RenderWindow window(sf::VideoMode(800, 600), "Hello World");
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Blue);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
{
window.close();
}
}
window.clear();
window.draw(shape);
window.display();
return 0;
}
}