首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

error LNK2019: 无法解析的外部符号解决思路

2012-02-25 
error LNK2019: 无法解析的外部符号1DIBAPI.obj : error LNK2019: 无法解析的外部符号 struct HPALETTE_

error LNK2019: 无法解析的外部符号
1>DIBAPI.obj : error LNK2019: 无法解析的外部符号 "struct HPALETTE__ * __cdecl CreateOctreePalette(unsigned char *,unsigned int,unsigned int)" (?CreateOctreePalette@@YAPAUHPALETTE__@@PAEII@Z),该符号在函数 "int __cdecl CopyColorTable(struct tagBITMAPINFO *,struct tagBITMAPINFO *,struct HPALETTE__ *)" (?CopyColorTable@@YAHPAUtagBITMAPINFO@@0PAUHPALETTE__@@@Z) 中被引用
1>DIBAPI.obj : error LNK2019: 无法解析的外部符号 __imp__timeGetTime@0,该符号在函数 "void __cdecl Delay(unsigned long)" (?Delay@@YAXK@Z) 中被引用
1>C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\DigImage\Debug\DigImage.exe : fatal error LNK1120: 2 个无法解析的外部命令





[解决办法]
timeGetTime需要你链接winmm.lib
#pragma comment(lib,"winmm");

CreateOctreePalette需要你链接对应的lib或者把人家的cpp加入你工程
[解决办法]
缺少lib或cpp
[解决办法]
多半是缺少lib的linker设置

把你需要从外部引用的函数的lib 文件加到linker的additional include 里面。
非标准库或者标准WIN32库的函数定义所在的文件都要自己linker的。

热点排行