error LNK2001: 无法解析的外部符号 “unsigned int __cdecl upx_adler32(void const *,unsigned int,unsigned int)”

本文主要是介绍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)”的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/758828

相关文章

Golang HashMap实现原理解析

《GolangHashMap实现原理解析》HashMap是一种基于哈希表实现的键值对存储结构,它通过哈希函数将键映射到数组的索引位置,支持高效的插入、查找和删除操作,:本文主要介绍GolangH... 目录HashMap是一种基于哈希表实现的键值对存储结构,它通过哈希函数将键映射到数组的索引位置,支持

Python使用getopt处理命令行参数示例解析(最佳实践)

《Python使用getopt处理命令行参数示例解析(最佳实践)》getopt模块是Python标准库中一个简单但强大的命令行参数处理工具,它特别适合那些需要快速实现基本命令行参数解析的场景,或者需要... 目录为什么需要处理命令行参数?getopt模块基础实际应用示例与其他参数处理方式的比较常见问http

Python利用ElementTree实现快速解析XML文件

《Python利用ElementTree实现快速解析XML文件》ElementTree是Python标准库的一部分,而且是Python标准库中用于解析和操作XML数据的模块,下面小编就来和大家详细讲讲... 目录一、XML文件解析到底有多重要二、ElementTree快速入门1. 加载XML的两种方式2.

Java的栈与队列实现代码解析

《Java的栈与队列实现代码解析》栈是常见的线性数据结构,栈的特点是以先进后出的形式,后进先出,先进后出,分为栈底和栈顶,栈应用于内存的分配,表达式求值,存储临时的数据和方法的调用等,本文给大家介绍J... 目录栈的概念(Stack)栈的实现代码队列(Queue)模拟实现队列(双链表实现)循环队列(循环数组

java解析jwt中的payload的用法

《java解析jwt中的payload的用法》:本文主要介绍java解析jwt中的payload的用法,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录Java解析jwt中的payload1. 使用 jjwt 库步骤 1:添加依赖步骤 2:解析 JWT2. 使用 N

Python中__init__方法使用的深度解析

《Python中__init__方法使用的深度解析》在Python的面向对象编程(OOP)体系中,__init__方法如同建造房屋时的奠基仪式——它定义了对象诞生时的初始状态,下面我们就来深入了解下_... 目录一、__init__的基因图谱二、初始化过程的魔法时刻继承链中的初始化顺序self参数的奥秘默认

Java 正则表达式URL 匹配与源码全解析

《Java正则表达式URL匹配与源码全解析》在Web应用开发中,我们经常需要对URL进行格式验证,今天我们结合Java的Pattern和Matcher类,深入理解正则表达式在实际应用中... 目录1.正则表达式分解:2. 添加域名匹配 (2)3. 添加路径和查询参数匹配 (3) 4. 最终优化版本5.设计思

使用Java将DOCX文档解析为Markdown文档的代码实现

《使用Java将DOCX文档解析为Markdown文档的代码实现》在现代文档处理中,Markdown(MD)因其简洁的语法和良好的可读性,逐渐成为开发者、技术写作者和内容创作者的首选格式,然而,许多文... 目录引言1. 工具和库介绍2. 安装依赖库3. 使用Apache POI解析DOCX文档4. 将解析

Java字符串处理全解析(String、StringBuilder与StringBuffer)

《Java字符串处理全解析(String、StringBuilder与StringBuffer)》:本文主要介绍Java字符串处理全解析(String、StringBuilder与StringBu... 目录Java字符串处理全解析:String、StringBuilder与StringBuffer一、St

Spring Boot循环依赖原理、解决方案与最佳实践(全解析)

《SpringBoot循环依赖原理、解决方案与最佳实践(全解析)》循环依赖指两个或多个Bean相互直接或间接引用,形成闭环依赖关系,:本文主要介绍SpringBoot循环依赖原理、解决方案与最... 目录一、循环依赖的本质与危害1.1 什么是循环依赖?1.2 核心危害二、Spring的三级缓存机制2.1 三