本文主要是介绍error LNK2001: 无法解析的外部符号 “unsigned int __cdecl upx_adler32(void const *,unsigned int,unsigned int)”,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
转自VC错误:http://www.vcerror.com/?p=1413问题描述:
把upx源码的exe工程改造成了一个lib库文件,编译了一个exe调用lib库文件中的函数,结果exe编译出现如以下错误
1>upxlib.lib(p_unix.obj) : error LNK2001: 无法解析的外部符号 “unsigned int __cdecl upx_adler32(void const *,unsigned int,unsigned int)” (?upx_adler32@@YAIPBXII@Z)
1>upxlib.lib(p_lx_interp.obj) : error LNK2001: 无法解析的外部符号 “unsigned int __cdecl upx_adler32(void const *,unsigned int,unsigned int)” (?upx_adler32@@YAIPBXII@Z)
1>upxlib.lib(p_ps1.obj) : error LNK2001: 无法解析的外部符号 “unsigned int __cdecl upx_adler32(void const *,unsigned int,unsigned int)” (?upx_adler32@@YAIPBXII@Z)
1>upxlib.lib(p_mach.obj) : error LNK2019: 无法解析的外部符号 “unsigned int __cdecl upx_adler32(void const *,unsigned int,unsigned int)” (?upx_adler32@@YAIPBXII@Z),该符号在函数 “public: __thiscall PackMachBase<struct N_Mach::MachClass_64<struct N_BELE_CTP::LEPolicy> >::PackMachBase<struct N_Mach::MachClass_64<struct N_BELE_CTP::LEPolicy> >(class InputFile *,unsigned int,unsigned int,unsigned int,unsigned int,unsigned int)” (??0?$PackMachBase@U?$MachClass_64@ULEPolicy@N_BELE_CTP@@@N_Mach@@@@QAE@PAVInputFile@@IIIII@Z) 中被引用
1>upxlib.lib(filter.obj) : error LNK2001: 无法解析的外部符号 “unsigned int __cdecl upx_adler32(void const *,unsigned int,unsigned int)” (?upx_adler32@@YAIPBXII@Z)
1>upxlib.lib(main.obj) : error LNK2001: 无法解析的外部符号 “unsigned int __cdecl upx_adler32(void const *,unsigned int,unsigned int)” (?upx_adler32@@YAIPBXII@Z)
1>upxlib.lib(packer.obj) : error LNK2001: 无法解析的外部符号 “unsigned int __cdecl upx_adler32(void const *,unsigned int,unsigned int)” (?upx_adler32@@YAIPBXII@Z)
1>upxlib.lib(p_lx_exc.obj) : error LNK2001: 无法解析的外部符号 “unsigned int __cdecl upx_adler32(void const *,unsigned int,unsigned int)” (?upx_adler32@@YAIPBXII@Z)
1>upxlib.lib(p_lx_elf.obj) : error LNK2001: 无法解析的外部符号 “unsigned int __cdecl upx_adler32(void const *,unsigned int,unsigned int)” (?upx_adler32@@YAIPBXII@Z)
1>upxlib.lib(p_ps1.obj) : error LNK2001: 无法解析的外部符号 “int __cdecl upx_compress(unsigned char const *,unsigned int,unsigned char *,unsigned int *,struct upx_callback_t *,int,int,struct upx_compress_config_t const *,struct upx_compress_result_t *)” (?upx_compress@@YAHPBEIPAEPAIPAUupx_callback_t@@HHPBUupx_compress_config_t@@PAUupx_compress_result_t@@@Z)
1>upxlib.lib(p_mach.obj) : error LNK2001: 无法解析的外部符号 “int __cdecl upx_compress(unsigned char const *,unsigned int,unsigned char *,unsigned int *,struct upx_callback_t *,int,int,struct upx_compress_config_t const *,struct upx_compress_result_t *)” (?upx_compress@@YAHPBEIPAEPAIPAUupx_callback_t@@HHPBUupx_compress_config_t@@PAUupx_compress_result_t@@@Z)
1>upxlib.lib(p_unix.obj) : error LNK2001: 无法解析的外部符号 “int __cdecl upx_compress(unsigned char const *,unsigned int,unsigned char *,unsigned int *,struct upx_callback_t *,int,int,struct upx_compress_config_t const *,struct upx_compress_result_t *)” (?upx_compress@@YAHPBEIPAEPAIPAUupx_callback_t@@HHPBUupx_compress_config_t@@PAUupx_compress_result_t@@@Z)
1>upxlib.lib(packer.obj) : error LNK2019: 无法解析的外部符号 “int __cdecl upx_compress(unsigned char const *,unsigned int,unsigned char *,unsigned int *,struct upx_callback_t *,int,int,struct upx_compress_config_t const *,struct upx_compress_result_t *)” (?upx_compress@@YAHPBEIPAEPAIPAUupx_callback_t@@HHPBUupx_compress_config_t@@PAUupx_compress_result_t@@@Z),该符号在函数 “protected: virtual bool __thiscall Packer::compress(unsigned char *,unsigned int,unsigned char *,struct upx_compress_config_t const *)” (?compress@Packer@@MAE_NPAEI0PBUupx_compress_config_t@@@Z) 中被引用
1>upxlib.lib(p_exe.obj) : error LNK2001: 无法解析的外部符号 “int __cdecl upx_compress(unsigned char const *,unsigned int,unsigned char *,unsigned int *,struct upx_callback_t *,int,int,struct upx_compress_config_t const *,struct upx_compress_result_t *)” (?upx_compress@@YAHPBEIPAEPAIPAUupx_callback_t@@HHPBUupx_compress_config_t@@PAUupx_compress_result_t@@@Z)
1>upxlib.lib(p_lx_elf.obj) : error LNK2001: 无法解析的外部符号 “int __cdecl upx_compress(unsigned char const *,unsigned int,unsigned char *,unsigned int *,struct upx_callback_t *,int,int,struct upx_compress_config_t const *,struct upx_compress_result_t *)” (?upx_compress@@YAHPBEIPAEPAIPAUupx_callback_t@@HHPBUupx_compress_config_t@@PAUupx_compress_result_t@@@Z)
1>upxlib.lib(p_vmlinx.obj) : error LNK2001: 无法解析的外部符号 “int __cdecl upx_compress(unsigned char const *,unsigned int,unsigned char *,unsigned int *,struct upx_callback_t *,int,int,struct upx_compress_config_t const *,struct upx_compress_result_t *)” (?upx_compress@@YAHPBEIPAEPAIPAUupx_callback_t@@HHPBUupx_compress_config_t@@PAUupx_compress_result_t@@@Z)
1>upxlib.lib(packer.obj) : error LNK2019: 无法解析的外部符号 “int __cdecl upx_decompress(unsigned char const *,unsigned int,unsigned char *,unsigned int *,int,struct upx_compress_result_t const *)” (?upx_decompress@@YAHPBEIPAEPAIHPBUupx_compress_result_t@@@Z),该符号在函数 “protected: virtual bool __thiscall Packer::compress(unsigned char *,unsigned int,unsigned char *,struct upx_compress_config_t const *)” (?compress@Packer@@MAE_NPAEI0PBUupx_compress_config_t@@@Z) 中被引用
1>upxlib.lib(p_ps1.obj) : error LNK2001: 无法解析的外部符号 “int __cdecl upx_decompress(unsigned char const *,unsigned int,unsigned char *,unsigned int *,int,struct upx_compress_result_t const *)” (?upx_decompress@@YAHPBEIPAEPAIHPBUupx_compress_result_t@@@Z)
1>upxlib.lib(linker.obj) : error LNK2001: 无法解析的外部符号 “int __cdecl upx_decompress(unsigned char const *,unsigned int,unsigned char *,unsigned int *,int,struct upx_compress_result_t const *)” (?upx_decompress@@YAHPBEIPAEPAIHPBUupx_compress_result_t@@@Z)
1>upxlib.lib(packer.obj) : error LNK2019: 无法解析的外部符号 “int __cdecl upx_test_overlap(unsigned char const *,unsigned char const *,unsigned int,unsigned int,unsigned int *,int,struct upx_compress_result_t const *)” (?upx_test_overlap@@YAHPBE0IIPAIHPBUupx_compress_result_t@@@Z),该符号在函数 “bool __cdecl ph_testOverlappingDecompression(class PackHeader const &,unsigned char const *,unsigned char const *,unsigned int)” (?ph_testOverlappingDecompression@@YA_NABVPackHeader@@PBE1I@Z) 中被引用
解决方法:
具体的解决方法参考文章:http://www.vcerror.com/?p=1413
这篇关于error LNK2001: 无法解析的外部符号 “unsigned int __cdecl upx_adler32(void const *,unsigned int,unsigned int)”的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!