SFML 2.5.1 错误 LNK1112 模块机器类型 'x86' 与目标机器类型 'x64' 冲突
SFML 2.5.1 Error LNK1112 module machine type 'x86' conflicts with target machine type 'x64'
我在 Visual Studio 2019 年尝试使用 SFML 库。结果遇到了那个错误。
我使用源代码和默认设置为 x64 生成器的 cmake 创建了二进制文件。我关注并链接了所有库和依赖项。
I even followed this and couldn't get to resolve the issue
#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;
}
我是 VS 和编程新手。任何帮助,尤其是新手友好的帮助,我们将不胜感激
错误是由于您试图混合 32 位和 64 位文件造成的。如果您的项目是 64 位 (x64),您还需要 64 位的 SFML(以及所有其他依赖项)。 32 位 (x86) 也是如此。
我在 Visual Studio 2019 年尝试使用 SFML 库。结果遇到了那个错误。 我使用源代码和默认设置为 x64 生成器的 cmake 创建了二进制文件。我关注并链接了所有库和依赖项。
I even followed this and couldn't get to resolve the issue
#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;
}
我是 VS 和编程新手。任何帮助,尤其是新手友好的帮助,我们将不胜感激
错误是由于您试图混合 32 位和 64 位文件造成的。如果您的项目是 64 位 (x64),您还需要 64 位的 SFML(以及所有其他依赖项)。 32 位 (x86) 也是如此。