R
R
ratatyq2016-08-24 22:17:50
C++ / C#
ratatyq, 2016-08-24 22:17:50

The default application on the SFML library is not compiled, what should I do?

Hello, the default code of the SFML library does not want to be compiled,

#include <SFML/Graphics.hpp>

int main()
{
  sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
  sf::CircleShape shape(100.f);
  shape.setFillColor(sf::Color::Green);

  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;
}

Gives the following error:
Error LNK2019 reference to unresolved external symbol [email protected] in function "int __cdecl invoke_main(void)" ([email protected]@YAHXZ) TestGameSfml D:\Programming code c++\TestGameSfml\TestGameSfml\MSVCRTD.lib(exe_winmain.obj)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
AtomKrieg, 2016-08-24
@ratatyq

g.zeos.in/?q=sfml%20LNK2019%20

K
Konstantin Stepanov, 2016-08-25
@koronabora

Little information - development environment, are SFML linked, are the paths to lib and h files connected?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question