visual-c++ - libgcrypt.lib中无法解析的外部符号

标签 visual-c++ libvlc unresolved-external libgcrypt

如果我在.lib(library)文件中找到了未解析的外部符号,该怎么办。如果我在.c或.cpp中发现了无法解析的外部符号,则可以对其进行修复。但是,当我在.lib(library)文件中找到未解析的外部符号时,该如何解决呢?

就我而言,我发现了这样的链接器错误:

错误1错误LNK2019:函数_fprintf中引用的未解析的外部符号___mingw_vfprintf D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(libgcrypt_la-global.o)
错误2错误LNK2001:无法解析的外部符号___mingw_vfprintf D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(libgcrypt_la-misc.o)
错误3错误LNK2001:无法解析的外部符号_gpg_strerror D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(ecc.o)
错误4错误LNK2019:函数__gcry_strerror中引用的未解析的外部符号_gpg_strerror D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(libgcrypt_la-global.o)
错误5错误LNK2001:无法解析的外部符号_gpg_strerror D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(libgcrypt_la-misc.o)
错误6错误LNK2001:无法解析的外部符号_gpg_strerror D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(md.o)
错误7错误LNK2001:无法解析的外部符号_gpg_strerror D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(libgcrypt_la-fips.o)
错误8错误LNK2019:函数__gcry_strsource D中引用了未解析的外部符号_gpg_strsource D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(libgcrypt_la-global.o)
错误9错误LNK2019:函数_do_malloc D中引用的未解析外部符号_gpg_err_set_errno D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(libgcrypt_la-global.o)
错误10错误LNK2001:无法解析的外部符号_gpg_err_set_errno D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(libgcrypt_la-stdmem.o)
错误11错误LNK2001:无法解析的外部符号_gpg_err_set_errno D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(libgcrypt_la-secmem.o)
错误12错误LNK2001:无法解析的外部符号_gpg_err_code_from_errno D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(libgcrypt_la-module.o)
错误13错误LNK2019:函数_gpg_err_make_from_errno D中引用的未解析的外部符号_gpg_err_code_from_errno D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(lib。
错误14错误LNK2001:无法解析的外部符号_gpg_err_code_from_errno D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(libgcrypt_la-sexp.o)
错误15错误LNK2001:无法解析的外部符号_gpg_err_code_from_errno D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(md.o)
错误16错误LNK2001:无法解析的外部符号_gpg_err_code_from_errno D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(primegen.o)
错误17错误LNK2019:函数_sprintf中引用的未解析的外部符号___mingw_vsprintf D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(libgcrypt_la-sexp.o)
错误18错误LNK2001:无法解析的外部符号___mingw_vsprintf D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(ac.o)
错误19错误LNK2001:无法解析的外部符号_gpg_err_code_from_syserror D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(primegen.o)
错误20错误LNK2019:函数_progress D中引用的未解决的外部符号_gpg_err_code_from_syserror D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(dsa.o)
错误21错误LNK2001:无法解析的外部符号_gpg_err_code_from_syserror D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(ecc.o)
错误22错误LNK2001:无法解析的外部符号_gpg_err_code_from_syserror D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(random-fips.o)
错误23错误LNK2001:无法解析的外部符号_gpg_err_code_from_syserror D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(mpicoder.o)
错误24错误LNK2001:无法解析的外部符号_gpg_err_code_from_syserror D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(cipher.o)
错误25错误LNK2001:无法解析的外部符号_gpg_err_code_from_syserror D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(pubkey.o)
错误26错误LNK2001:无法解析的外部符号_gpg_err_code_from_syserror D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(kdf.o)
错误27错误LNK2019:函数__gcry_pk_get_keygrip D中引用的未解析的外部符号_snprintf D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(pubkey.o)
错误28错误LNK2001:无法解析的外部符号_snprintf D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(md.o)
错误29错误LNK2001:无法解析的外部符号_snprintf D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(ecc.o)
错误30错误LNK2001:无法解析的外部符号_snprintf D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(rndw32.o)
错误31错误LNK2019:函数_init_pool D中引用的未解析的外部符号_getpagesize:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(libgcrypt_la-secmem.o)
错误32错误LNK2019:函数_x931_get_dt D中引用的未解析的外部符号_gettimeofday D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(random-fips.o)
错误33错误LNK2001:无法解析的外部符号_gettimeofday D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib(random-csprng.o)
错误34错误LNK1120:10个未解决的外部D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ Release \ libvlccore.dll
错误89错误LNK2001:无法解析的外部符号“ public:虚拟结构QMetaObject const * __thiscall UpdateDialog :: metaObject(void)const”(?metaObject @ UpdateDialog @@ UBEPBUQMetaObject @@ XZ)D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_inmbed \ help.obj
错误90错误LNK2001:无法解析的外部符号“公共:虚拟void * __thiscall UpdateDialog :: qt_metacast(char const *)”(?qt_metacast @ UpdateDialog @@ UAEPAXPBD @ Z)D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_Embeddedlib \ in .obj
错误91错误LNK2001:无法解析的外部符号“公共:虚拟int __thiscall UpdateDialog :: qt_metacall(枚举QMetaObject :: Call,int,void * *)”(?qt_metacall @ UpdateDialog @@ UAEHW4Call @ QMetaObject @@ HPAPAX @ Z)D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ lib_plugin \ help.obj
错误92错误LNK1120:3未解决的外部D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ Release \ plugins \ lib_plugin.dll

关于此的任何建议将有所帮助。

最佳答案

好吧,基本上,您必须找到具有该符号的库-.lib或.a(取决于平台)文件。静态库在链接到可执行库或共享库之前不会解析其符号,因此您可能拥有一个静态库,该库未解析其所有符号。您可以使用第1点下面提到的工具来验证这一点-当您转储符号时,未解析的符号将在它们前面带有U字母。当您将它们链接到应用程序时,链接器必须解析所有符号,如果缺少某些符号,则会出现无法解析的参考错误。您基本上有两个选择:

1)使用符号转储实用程序,例如nm(在Windows上为Linux和MinGW)或dumpbin(在Windows上为Visual Studio)和grep作为符号(如果您的目录充满了库,则可以创建一个脚本来执行此操作)每个文件),然后在您知道正确的库文件后,将代码链接至该文件(再次取决于Linux和MinGW窗口的平台-l<library name>开关,添加#pragma comment(lib, "<library name>")或通过Visual Studio中的属性页指定该库。

2)如果您具有所有库的源代码,则可以执行纯文本搜索以定义函数,然后链接具有源代码库的库。

3)即使您已经与适当的库链接,但C和C ++代码混合在一起,也可能出现这些问题。具有C接口的库的标头应包含在extern "C"块中,以便当只有具有C名称的函数可用时,链接程序不会尝试查找具有C ++名称的函数。对于FFmpeg和其他大型开源项目的初学者来说,这是一个常见问题。

更新

至于__mingw_vfprinf的原始问题-您将使用MinGW与Visual Studio编译的代码链接起来有点奇怪,我想说您最好也将MinGW用于您的项目,但建议在similar topic中,这可能是由于缺少libmingwex.a引起的。如果您具有MinGW工具链,请找到文件所在的位置,然后通过Visual Studio属性页将该目录添加到链接程序搜索目录中,并通过Visual Studio属性页或通过提到的编译指示将libmingwex.a作为链接程序输入添加到项目中以上。如果您没有MinGW工具链,则应该下载它,但是您需要获得正确的平台-但是我想,因为您将库放在某个地方,所以知道它是32位还是64位。

更新2

这是MinGW软件包管理器的示例屏幕快照,显示了哪个软件包包含该库:

关于visual-c++ - libgcrypt.lib中无法解析的外部符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26401518/

相关文章:

c++ - Microsoft Visual C++ Express 中是否提供创建工作区的选项?

c++ - 为什么这是一个最终递归可变参数宏?

C# LibVLCSharp 播放器直接馈送媒体

c++ - 应用程序无法链接到 mysql 库 (CentOS)

c++ - 如何像初始化一样给结构赋值

visual-c++ - Visual C++ : How is checked_array_iterator useful?

java - VLCJ 简单应用程序可以打包为 jar,但不能在 BlueJ 中使用

c - 当我在 C 和 Ubuntu 中使用 fork() 时,Vlc 库失败

delphi - 无法解析的外部 UrlCombineW

com - 在 native 中托管 CLR - COM 接口(interface),未解析的外部符号 _CStdStubBuffer_Release@4