-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