小编use*_*569的帖子

MingW静态库链接 - SFML 2.1

我试图让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)

c++ mingw undefined-reference

6
推荐指数
1
解决办法
3459
查看次数

标签 统计

c++ ×1

mingw ×1

undefined-reference ×1