我试图让SFML 2.1与MingW一起工作,但这会导致问题.
我在MingW编译器中的编译行是:
g++ -ID:\SFML-2.1\include -LD:\SFML-2.1\lib main.cpp -lsfml-graphics -lsfml-window -lsfml-system
Run Code Online (Sandbox Code Playgroud)
我正在尝试链接.a文件(这是否意味着我应该添加soemthing to eh compile line?).
代码如下:
#include <SFML/Graphics.hpp>
int main()
{
// create the window
sf::RenderWindow window(sf::VideoMode(800, 600), "My window");
// run the program as long as the window is open
while (window.isOpen())
{
// check all the window's events that were triggered since the last iteration of the loop
sf::Event event;
while (window.pollEvent(event))
{
// "close requested" event: we close the window
if (event.type == sf::Event::Closed)
window.close();
}
// …Run Code Online (Sandbox Code Playgroud)