Unresolved External Symbol: LNK 2001

老子叫甜甜 提交于 2019-12-13 05:35:32

问题


I just installed SFML packages using NuGET Package Manager. After installing it. I ran a basic program from its official page. Just copy and paste.

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

When I run this i get LNK 2001 error. Stating Unresolved External Symbol.

My Own TRY

I searched on google and found that the problem is it with the lib files. I found the files in the package folder, none of them are listed on the tools, Project->Properties.

Tried adding SFML_DYNAMIC, didn't work;


回答1:


You need to add appropriate libs to linker dependencies in your project. Add library name(s) to Project->Properties->Linker->Input->Additional Dependencies.

Here is SFML tutorial on configuring Visual Studio project.



来源:https://stackoverflow.com/questions/34162014/unresolved-external-symbol-lnk-2001

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!