Unresolved external symbol in libgcrypt.lib

What do I need to do if I find an Unresolved external symbol in the .lib (library) file. If I find an unresolved external symbol in .c or .cpp, I can fix it. But when I found an unresolved external symbol in the .lib (library) file, how can I solve this?

In my case, I found a linker error like this:

Error 1 error LNK2019: unresolved external symbol ___mingw_vfprintf specified in function _fprintf D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt_lib error \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib (libgcrypt_la-misc.o) error 3 error LNK2001: unresolved external symbol _gpg_strerror D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib (ecc.o) error 4 errors LNK2019: Unresolved external symbol _gpg_strerror specified in __gcry_strerror function D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib (libgcrypt_la-global.o) Error 5 LNK2001 error: unresolved external symbol _gpg_strerror D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcryptl error (unresolved 6) symbol _gpg_strerror external_symbol : \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib (md.o) 7 failed error LNK2001: unresolved external symbol _gpg_strerror D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib (libgcrypt_la-fips. o) Error 8 error LNK2019: Unresolved external symbol _gpg_strsource specified in __gcry_strsource function D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt-globalo) Error 9 LNK2019 error: Unresolved external symbol _gpg_err_set_errno refers to the _do_malloc function D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt error external_signature \ libgcrypt error 10glcrypt external symbol (unresolved) VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib (libgcrypt_la-stdmem.o) error 11 error LNK2001: unresolved external symbol _gpg_err_set_errno D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib (libgcrypt_la-secmem. o) Error 12 of LNK2001 error: Unresolved external symbol _gpg_err_code_from_errno D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib (libgcrypt_la-module.o) Error 13 error LNK2019: unresolved external symbol _gpg_err_code_from_errno link in function _gpg_err_make_from_errno D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ VidplayNemba_Pludinerrno error external symbol _gpg_err_code_from_errno D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib (libgcrypt_la-sexp.o) error 15 error LNK2001: unresolved external symbol _gpg_err_code_from_errno D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt. lib (md.o) Error 16 error LNK2001: unresolved external symbol _gpg_err_code_from_errno D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib (primegen.o) Error 17 error LNK2019: unresolved external symbol ___mingw_vsprintf, referenced function _sprintf D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib (libgcrypt_la-sexp.o) error 18 error LNK2001: unresolved external symbol ___mingw_vsprintf D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib (ac.o) error 19 error LNK2001: unresolved external symbol _gpg_err_code_from_syserror D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib (primegen.o) Error 20 LNK2019 error: Unresolved external symbol _gpg_err_code_from_syserror,function specified in _progress D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib (dsa.o) Error 21 error LNK2001: unresolved external symbol _gpg_err_code_from_syserror D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib (ecc.o) Error 22 error LNK2001: unresolved external symbol _gpg_err_code_from_syserror D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore error \ libgcrypt.alip (random_from_syserror) \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib (mpicoder.o) Error 24 LNK2001: Unresolved external symbol _gpg_err_code_from_syserror D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib (cipher.o) Error 25 error LNK2001: unresolved external symbol _gpg_err_code_from_syserror D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib (pubkey.o) Error 26 error LNK2001: unresolved external symbol _gpg_err_code_from_syserror D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib (kdf.o) error 27 error LNK2019: unresolved external symbol _snprintf, specified in the function __gcry_pk_get_keygrip D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib (pubkey.o) Error 28 error LNK2001: Unresolved external symbol _snprintf D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib (md.o) Error 29 error LNK2001: unresolved external symbol _snprintf D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib (ecc.o) Error 30 error LNK2001: unresolved external symbol _snprintf D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib (rndw32.o) error 31 error LNK2019: unresolved external symbol _getpagesize refers to the function _init_pool D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib (libgcrypt_la-secmem.o) Error 32 LNK2019 errors: Unresolved external symbol _gettimeofday specified in function _x931_get_dt D:\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib (random-fips.o) Error 33 error LNK2001: unresolved external symbol _gettimeofday D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ libvlccore \ libgcrypt.lib (random-csprng .o) Error 34 LNK1120 errors: 10 unresolved external D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ Release \ libvlccore.dll Error 89 LNK2001 error: Unresolved external symbol "public: virtual const * QMetaOject ) const "(? MetaObject @UpdateDialog @@ UBEPBUQMetaObject @@ XZ) D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ lib_plugin: error helpN.obj2001 errorunresolved external symbol "public: virtual void * __thiscall UpdateDialog :: qt_metacast (char const *)" (? Qt_metacast @UpdateDialog @@ UAEPAXPBD @Z) D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ VidEmba_Plugin.Error \ VidEmba_Plugin LNK2001: unresolved external symbol "public: virtual int __thiscall UpdateDialog :: qt_metacall (enumeration QMetaObject :: Call, int, void * *)" (? Qt_metacall @UpdateDialog @@ UAEHW4Call @QMetaObject @@ HPAPAXline @Z) D: TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ lib_plugin \ help.obj Error 92 error LNK1120: 3 unresolved external D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_Embedded.dllqt_metacast (char const *) "(? Qt_metacast @UpdateDialog @@ UAEPAXPBD @Z) D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ lib_plugin \ lib_plugin error public_plugin \\\\\\\ lib_plugin \\\\\\\\\\ lib_plugin \\\\\\\\\\ lib_plugin \\\\\\\\\ lib_plugin \\\\\\\\\\\\ lib_plugin \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ lib_plugin your your : qt_metacall (enumeration QMetaObject :: Call, int, void * *) "(? Qt_metacall @UpdateDialog @@ UAEHW4Call @QMetaObject @@ HPAPAX @Z) D: \ VidPlaya_offline \ TryingToIncludeUpdateambacility \ VidingToIncludeUpdateambacility \ VidingToIncludeUpdateambacility \ Vidwinplugincall error error LNK1120: 3 unresolved external D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ Release \ plugins \ lib_plugin.dllqt_metacast (char const *) "(? Qt_metacast @UpdateDialog @@ UAEPAXPBD @Z) D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ lib_plugin \ lib_plugin error public_plugin \\\\\\\ lib_plugin \\\\\\\\\\ lib_plugin \\\\\\\\\\ lib_plugin \\\\\\\\\ lib_plugin \\\\\\\\\\\\ lib_plugin \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ lib_plugin your your : qt_metacall (enumeration QMetaObject :: Call, int, void * *) "(? Qt_metacall @UpdateDialog @@ UAEHW4Call @QMetaObject @@ HPAPAX @Z) D: \ VidPlaya_offline \ TryingToIncludeUpdateambacility \ VidingToIncludeUpdateambacility \ VidingToIncludeUpdateambacility \ Vidwinplugincall error error LNK1120: 3 unresolved external D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ Release \ plugins \ lib_plugin.dll\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ lib_plugin \ help.obj Error 91 LNK2001 error: unresolved external symbol "public: virtual int __thiscall UpdateDialog :: qt_metacall * (enum Qt_metacall * UpdateDialog @@ UAEHW4Call @QMetaObject @@ HPAPAX @Z) D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ lib_plugin \ help.obj error 92 error LNK1120: unresolved external 3 D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ Release \ plugins \ lib_plugin.dll\ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ lib_plugin \ help.obj Error 91 LNK2001 error: Unresolved external symbol "public: virtual int __thiscall UpdateDialog :: qt_metacall * (enum Qt_metacall * UpdateDialog @@ UAEHW4Call @QMetaObject @@ HPAPAX @Z) D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ lib_plugin \ help.obj error 92 error LNK1120: unresolved external 3 D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ Release \ plugins \ lib_plugin.dll(? Qt_metacall @UpdateDialog @@ UAEHW4Call @QMetaObject @@ HPAPAX @Z) D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ lib_plugin \ help.obj Error 92 error LNK1120: unresolved external 3 D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ Release \ plugins \ lib_plugin.dll(? Qt_metacall @UpdateDialog @@ UAEHW4Call @QMetaObject @@ HPAPAX @Z) D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ lib_plugin \ help.obj Error 92 error LNK1120: unresolved external 3 D: \ VidPlaya_offline \ TryingToIncludeUpdateFacility \ Vidplaya_Plugin_EmbeddedUpdate \ vlcwin \ Release \ plugins \ lib_plugin.dll

Any suggestions on this would be helpful.

+3


source to share


2 answers


Well, basically you have to find a library -.lib or .a (depending on the platform) file that has this symbol. Static libraries don't resolve their symbols until they are linked to an executable or shared library, so you might have a static library that doesn't have all of its symbols. You can check this using the tools mentioned below in point 1 - when you dump characters, the unresolved ones will have in front of it U

. And when you link them to your application, the linker should allow all symbols, and if something is missing, you will get unresolved reference errors. You basically have two options:

1) Use a utility to flush symbols like nm

(Linux and MinGW on Windows) or dumpbin

(Visual Studio for Windows) and grep for symbol (if you have a directory full of libraries, you can make a script that does this for each file), and then when you know the correct library file is linking your code to it (again platform dependent -l<library name>

for Linux and MinGW windows, add #pragma comment(lib, "<library name>")

or point the library via the pages property in Visual Studio.

2) Once you have sources for all the libraries, you can do a simple text search for the function definition and then link to the library that should be the source.

3) These problems can also appear even if you are already linking with the corresponding library but are mixed with C and C ++ code. Libraries with a C interface must have a header included in the block extern "C"

so that the linker doesn't try to find a function named C ++ when only a function named C is available. This is a common problem for beginners with FFmpeg and other large open source projects.

UPDATE



Regarding the original version with __mingw_vfprinf

- it's a bit strange that you link code that was compiled with MinGW with Visual Studio, I would say that you are better off using MinGW for your project, but as suggested in a similar topic , this might be the reason absence libmingwex.a

. If you have the MinGW toolchain, find where the file is, add that directory to the linker search directories via the Visual Studio property pages and addlibmingwex.a

as a linker attachment to your project, either through the Visual Studio property pages or through the pragma mentioned above. If you don't have the MinGW instrumental combination, you should download it, but you need to get the correct platform - however, I think since you got the library somewhere, if you know, 32-bit or 64-bit.

UPDATE 2

Here is an example screenshot of the MinGW package manager showing which package contains the library:

MinGW package manager showing libmingwex.a

+2


source


My experience with other runtime library implementations allows me to assume that the various options are printf

implemented by calling a lower level form vprintf

. fprintf

was put in a .o file (why? Isn't this the RTL function itself?) and it needs this helper function. I believe from the name decorations can be found in the mingw system library. I believe the printf functions are in an additional library that you need to link with as it is improved over the versions in msvcrt.dll.



So look for this. Check your versions as it is possible the lib was built against a different version than you are currently using and this data has changed.

+1


source







All Articles