使用Freeimage库时报错的解决方法

来源:互联网 发布:旅行团乐队知乎 编辑:程序博客网 时间:2024/06/05 11:10

1>TextureManager.obj : error LNK2019: 无法解析的外部符号 __imp__FreeImage_Unload@4,该符号在函数 "public: bool __thiscall TextureManager::LoadTexture(char const *,unsigned int,unsigned int,int,int,int)" (?LoadTexture@TextureManager@@QAE_NPBDIIHHH@Z) 中被引用1>TextureManager.obj : error LNK2019: 无法解析的外部符号 __imp__FreeImage_Load@12,该符号在函数 "public: bool __thiscall TextureManager::LoadTexture(char const *,unsigned int,unsigned int,int,int,int)" (?LoadTexture@TextureManager@@QAE_NPBDIIHHH@Z) 中被引用1>TextureManager.obj : error LNK2019: 无法解析的外部符号 __imp__FreeImage_GetFIFFromFilename@4,该符号在函数 "public: bool __thiscall TextureManager::LoadTexture(char const *,unsigned int,unsigned int,int,int,int)" (?LoadTexture@TextureManager@@QAE_NPBDIIHHH@Z) 中被引用1>TextureManager.obj : error LNK2019: 无法解析的外部符号 __imp__FreeImage_FIFSupportsReading@4,该符号在函数 "public: bool __thiscall TextureManager::LoadTexture(char const *,unsigned int,unsigned int,int,int,int)" (?LoadTexture@TextureManager@@QAE_NPBDIIHHH@Z) 中被引用1>TextureManager.obj : error LNK2019: 无法解析的外部符号 __imp__FreeImage_GetFileType@8,该符号在函数 "public: bool __thiscall TextureManager::LoadTexture(char const *,unsigned int,unsigned int,int,int,int)" (?LoadTexture@TextureManager@@QAE_NPBDIIHHH@Z) 中被引用1>TextureManager.obj : error LNK2019: 无法解析的外部符号 __imp__FreeImage_GetBits@4,该符号在函数 "public: bool __thiscall TextureManager::LoadTexture(char const *,unsigned int,unsigned int,int,int,int)" (?LoadTexture@TextureManager@@QAE_NPBDIIHHH@Z) 中被引用1>TextureManager.obj : error LNK2019: 无法解析的外部符号 __imp__FreeImage_GetWidth@4,该符号在函数 "public: bool __thiscall TextureManager::LoadTexture(char const *,unsigned int,unsigned int,int,int,int)" (?LoadTexture@TextureManager@@QAE_NPBDIIHHH@Z) 中被引用1>TextureManager.obj : error LNK2019: 无法解析的外部符号 __imp__FreeImage_GetHeight@4,该符号在函数 "public: bool __thiscall TextureManager::LoadTexture(char const *,unsigned int,unsigned int,int,int,int)" (?LoadTexture@TextureManager@@QAE_NPBDIIHHH@Z) 中被引用


C++环境

只需要在文件开头加上一句话,这样子

#include <FreeImage.h>#pragma comment(lib,"FreeImage.lib")


0 0