Hello there!
I use IDE CodeLite and wrote the following code:
#include <SFML/Graphics.hpp>
using namespace sf;
int main()
{
RenderWindow window(VideoMode(550, 200), "test");
Texture t;
t.loadFromFile("images\hero.png");
Sprite s;
s.setTexture(t);
s.setPosition(50 , 25);
while (window.isOpen())
{
Event event;
while (window.pollEvent(event))
{
if (event.type == Event::Closed)
window.close();
}
window.clear();
window.draw(s);
window.display();
}
return 0;
}
And when i click "Run" enter goes error:
F:/MyProject/SFML/First/main.cpp:8: undefined reference to `sf::Texture::loadFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, sf::Rect<int> const&)'
What's wrong?
I was looking for an explanation, but I couldn't find
The program was set up as stated here:
https://en.sfml-dev.org/forums/index.php?topic=18820.0When i use code, how here:
https://www.sfml-dev.org/tutorials/2.4/start-cb.php it worked
If need something to add, I'll do