English 中文(简体)
安装 krb5 时获得的未定义引用@ rb_ maybe_init@ GLIBC_ PRIVATE
原标题:undefined reference to `__res_maybe_init@GLIBC_PRIVATE got while installing krb5
During installing krb5 via brew install krb5, got this error: gcc-14 -L../../lib -Wl,--enable-new-dtags -Wl,-rpath -Wl,~/opt/brew/Cellar/krb5/1.21.3/lib -g -O2 -DHAVE_CONFIG_H -I../../include -I../../include -DKRB5_DEPRECATED=1 -DKRB5_PRIVATE -g -O2 -Wall -Wcast-align -Wshadow -Wmissing-prototypes -Wno-format-zero-length -Woverflow -Wstrict-overflow -Wmissing-format-attribute -Wmissing-prototypes -Wreturn-type -Wmissing-braces -Wparentheses -Wswitch -Wunused-function -Wunused-label -Wunused-variable -Wunused-value -Wunknown-pragmas -Wsign-compare -Werror=uninitialized -Wno-maybe-uninitialized -Werror=pointer-arith -Werror=int-conversion -Werror=incompatible-poin ter-types -Werror=discarded-qualifiers -Werror=implicit-int -Werror=declaration-after-statement -Werror-implicit-function-declaration -pthread -o test_getpw test_getpw.o -lkrb5support ~/opt/brew/opt/binutils/bin/ld: /lib/x86_64-linux-gnu/libresolv.so.2: undefined reference to `__res_maybe_init@GLIBC_PRIVATE when I check the /lib/x86_64-linux-gnu/libresolv.so.2, there is indeed such a symbol __res_maybe_init@GLIBC_PRIVATE: nm -D --with-symbol-versions /lib/x86_64-linux-gnu/libresolv.so.2 | grep __res_maybe_init U __res_maybe_init@GLIBC_PRIVATE Further more, I tried to list shared library dependencies of /lib/x86_64-linux-gnu/libresolv.so.2 $ ldd --verbose libresolv.so.2 linux-vdso.so.1 (0x00007ffc5f106000) libc.so.6 (0x00007f03328cc000) /lib64/ld-linux-x86-64.so.2 (0x00007f0332e82000) Version information: ./libresolv.so.2: libc.so.6 (GLIBC_2.14) => libc.so.6 libc.so.6 (GLIBC_2.4) => libc.so.6 libc.so.6 (GLIBC_PRIVATE) => libc.so.6 libc.so.6 (GLIBC_2.2.5) => libc.so.6 libc.so.6 (GLIBC_2.3) => libc.so.6 libc.so.6: ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2 ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2 $ env | grep LD_LIBRARY_PATH LD_LIBRARY_PATH=~/opt/brew/opt/binutils/lib:~/opt/brew/lib:~/opt/brew/opt/glibc/lib: $ find ~/opt/brew/opt/glibc/lib -name "*libc.so*" ~/opt/brew/opt/glibc/lib/libc.so ~/opt/brew/opt/glibc/lib/libc.so.6 I think libresolv.so is supposed to depend on my own glibc under ~/opt/brew/opt/glibc/lib/libc.so.6, but I don t know how to fix it $ ls ~/opt/brew/opt/glibc/lib | grep -e resolv libresolv.a libresolv.so libresolv.so.2 $ ls /lib/x86_64-linux-gnu | grep -e resolv libresolv-2.24.so libresolv.so.2 Any ideas else i can try?
问题回答
Any ideas else i can try? You are mixing different and mis-matching builds of GLIBC (libc.so.6 and libresolv.so.2 are both parts of GLIBC, and must come from the same build). Further, you build is very unlikely to work, for reasons explained here. If you are unwilling to use the system GLIBC, you must Get a complete set of GLIBC libraries under ~/opt/brew/opt/glibc/lib (including libresolv.so.2 and all the other parts), and Set the dynamic loader to ~/opt/brew/opt/glibc/lib/ld-linux-x86-64.so.2 (as explained in the linked answer).




相关问题
pthread functions "_np" suffix

What does "_np" suffix mean here: pthread_mutex_timedlock_np or in macros PTHREAD_MUTEX_TIMED_NP Upd: From glibc2.2 enum { PTHREAD_MUTEX_TIMED_NP, PTHREAD_MUTEX_RECURSIVE_NP, ...

using glibc malloc hooks in a thread safe manner

I would like to monitor the use of mallocs and frees in an application by using the malloc and free hooks. Here s the documentation http://www.gnu.org/s/libc/manual/html_node/Hooks-for-Malloc.html ...

GLIBCXX_3.4.9 not found

I have a problem concerning libstdc++.so. I installed a new version of gcc and tried to compile C++ code. The compiling worked, but when I try to execute the binary (m5.opt is its name) I ve got the ...

Issue with C function returning a gchar**

I have a function defined as the following (in C): gchar **Scan_Return_File_Tag_Field_From_Mask_Code (File_Tag *FileTag, gchar code) { switch (code) { case t : /* Title */ ...

Where is the implementation of strlen() in GCC?

Can anyone point me to the definition of strlen() in GCC? I ve been grepping release 4.4.2 for about a half hour now (while Googling like crazy) and I can t seem to find where strlen() is actually ...

Why inet_ntoa is designed to be a non-reentrant function?

Glancing at the source code of GNU C Library,I found the inet_ntoa is implementated with static __thread char buffer[18] My question is, since there is a need to use reeentrant inet_ntoa,why do not ...

热门标签