Answer the question
In order to leave comments, you need to log in
What to do if the linker swears?
#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;
}
1>------ Сборка начата: проект: Game1, Конфигурация: Debug Win32 ------
1>pch.cpp
1>Game1.cpp
1>Game1.obj : error LNK2001: неразрешенный внешний символ ""public: static class sf::RenderStates const sf::RenderStates::Default" ([email protected]@[email protected]@[email protected])"
1>Game1.obj : error LNK2001: неразрешенный внешний символ ""public: static class sf::Color const sf::Color::Green" ([email protected]@[email protected]@[email protected])"
1>E:\CPP\Game1\Debug\Game1.exe : fatal error LNK1120: неразрешенных внешних элементов: 2
1>Сборка проекта "Game1.vcxproj" завершена с ошибкой.
========== Сборка: успешно: 0, с ошибками: 1, без изменений: 0, пропущено: 0 ==========
Answer the question
In order to leave comments, you need to log in
In short, everything works for me, the problem was as follows: the
linker tried to find dll files that are in the SFML / bin folder, copy-paste all files from there to the project directory
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question