Red*_*son 1 c++ textures visual-studio sfml
我是初学者所以请光临我.我正在尝试使用SFML 2.1,C++和MS Visual Studio Professional 2013将图像输出到屏幕上.我在尝试将文件加载到纹理时遇到意外错误.它输出一大堆随机字符.我确定它是如何配置Visual Studio的SFML库或代码的问题.有人能解决这个问题吗?谢谢.
以下是我运行程序时的截图(http://i.stack.imgur.com/uMdLT.png):

这是我的代码:
#include <SFML/Graphics.hpp>
#include <iostream>
#include <string>
using namespace std;
int main() {
sf::RenderWindow window;
window.create(sf::VideoMode(800, 600), "My First SFML Game!"); // initializing
sf::Texture jetTexture;
sf::Sprite jetImage;
// Getting Error here!
if (!jetTexture.loadFromFile("fighter jet.png"))
throw std::runtime_error("Could not load fighter jet.png");
jetImage.setTexture(jetTexture);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.draw(jetImage);
window.display();
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
对于所有配置属性,它们如下所示:
链接器 - >常规(http://i.stack.imgur.com/NZg7P.png):

链接器 - >输入(http://i.stack.imgur.com/1tPaB.png):

**请注意,如果我没有按照我的方式配置SFML库,那么我的系统会收到错误消息msvcr110d.dll is missing.
编辑:查看更新代码.
好的,我设法解决了这个问题,这是你需要做的:


