-4
我想尝试自己在一个小小的C++应用程序,但我总是得到LNK2001错误,我不知道我做错了什么。C++ - LNK2001错误
有人可以帮我吗?
#ifndef CONTENTMANAGER_H
#define CONTENTMANAGER_H
#include "SFML\Graphics.hpp"
#include <map>
#include <sstream>
using namespace sf;
using namespace std;
static class CONTENTMANAGER
{
public:
static Texture getTexture(string textureName)
{
if(textureMap.find(textureName) == textureMap.end())
{
Texture texture;
stringstream ss;
ss<<"Texture"<<textureName<<".png";
texture.loadFromFile(ss.str());
textureMap.emplace(textureName, texture);
return textureMap[textureName];
}
else
{
return textureMap[textureName];
}
}
private:
static map<string,Texture> textureMap;
};
#endif
ERRORMESSAGE:http://www.bilderhoster.net/safeforbilder/5mdt1tzc.png
你在使用什么操作系统?你在编译什么?什么是完整的错误信息? – 2014-12-06 22:05:33
这将有助于查看完整的错误消息。很可能你没有编译与你的项目一起的'Texture'类函数调用的代码和/或没有正确地链接包含这些定义的库文件。 – Amadeus 2014-12-06 22:06:10
我已将我的错误消息加入我的文章 – 2014-12-06 22:11:13