monero-project / monero

Monero: the secure, private, untraceable cryptocurrency
https://getmonero.org
Other
9.01k stars 3.12k forks source link

how to solve building errors #6821

Closed ghost closed 4 years ago

ghost commented 4 years ago

Debin10 building errors: make -j14 release-static

[ 98%] Linking CXX executable ../../bin/monerod /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libzmq.a(libzmq_la-gssapi_client.o): in function zmq::gssapi_client_t::~gssapi_client_t()': (.text+0x59): undefined reference togss_release_cred' /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libzmq.a(libzmq_la-gssapi_client.o): in function zmq::gssapi_client_t::process_next_token(zmq::msg_t*) [clone .part.9]': (.text+0x246): undefined reference togss_release_name' /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libzmq.a(libzmq_la-gssapi_client.o): in function zmq::gssapi_client_t::~gssapi_client_t()': (.text+0x84c): undefined reference togss_release_cred' /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libzmq.a(libzmq_la-gssapi_client.o): in function zmq::gssapi_client_t::initialize_context()': (.text+0x8ca): undefined reference togss_init_sec_context' /usr/bin/ld: (.text+0x91d): undefined reference to gss_import_name' /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libzmq.a(libzmq_la-gssapi_client.o): in functionzmq::gssapi_client_t::produce_next_token(zmq::msg_t)': (.text+0x96c): undefined reference to gss_release_buffer' /usr/bin/ld: (.text+0x98e): undefined reference togss_release_buffer' /usr/bin/ld: (.text+0x99a): undefined reference to gss_release_name' /usr/bin/ld: (.text+0x9ae): undefined reference togss_release_name' /usr/bin/ld: (.text+0x9c3): undefined reference to gss_delete_sec_context' /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libzmq.a(libzmq_la-gssapi_server.o): in functionzmq::gssapi_server_t::~gssapi_server_t()': (.text+0x208): undefined reference to gss_release_cred' /usr/bin/ld: (.text+0x21c): undefined reference togss_release_name' /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libzmq.a(libzmq_la-gssapi_server.o): in function zmq::gssapi_server_t::~gssapi_server_t()': (.text+0x346): undefined reference togss_release_cred' /usr/bin/ld: (.text+0x35a): undefined reference to gss_release_name' /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libzmq.a(libzmq_la-gssapi_server.o): in functionzmq::gssapi_server_t::send_zap_request()': (.text+0x3ff): undefined reference to gss_display_name' /usr/bin/ld: (.text+0x428): undefined reference togss_release_buffer' /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libzmq.a(libzmq_la-gssapi_server.o): in function `zmq::gssapi_server_t::produce_next_token(zmq::msg_t)': (.text+0x48e): undefined reference to gss_release_buffer' /usr/bin/ld: (.text+0x4a0): undefined reference togss_release_name' /usr/bin/ld: (.text+0x4b5): undefined reference to gss_delete_sec_context' /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libzmq.a(libzmq_la-gssapi_server.o): in functionzmq::gssapi_server_t::process_next_token(zmq::msg_t)': (.text+0x599): undefined reference to gss_release_name' /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libzmq.a(libzmq_la-gssapi_server.o): in functionzmq::gssapi_server_t::accept_context()': (.text+0x5d6): undefined reference to gss_accept_sec_context' /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libzmq.a(libzmq_la-gssapi_mechanism_base.o): in functionzmq::gssapi_mechanism_base_t::~gssapi_mechanism_base_t()': (.text+0x126): undefined reference to gss_release_name' /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libzmq.a(libzmq_la-gssapi_mechanism_base.o): in functionzmq::gssapi_mechanism_base_t::~gssapi_mechanism_base_t()': (.text+0x176): undefined reference to gss_release_name' /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libzmq.a(libzmq_la-gssapi_mechanism_base.o): in functionzmq::gssapi_mechanism_base_t::encode_message(zmq::msg_t)': (.text+0x281): undefined reference to gss_wrap' /usr/bin/ld: (.text+0x300): undefined reference togss_release_buffer' /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libzmq.a(libzmq_la-gssapi_mechanism_base.o): in function zmq::gssapi_mechanism_base_t::decode_message(zmq::msg_t*)': (.text+0x590): undefined reference togss_unwrap' /usr/bin/ld: (.text+0x626): undefined reference to gss_release_buffer' /usr/bin/ld: (.text+0xa3e): undefined reference togss_release_buffer' /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libzmq.a(libzmq_la-gssapi_mechanism_base.o): in function zmq::gssapi_mechanism_base_t::convert_nametype(int)': (.text+0x1742): undefined reference toGSS_C_NT_USER_NAME' /usr/bin/ld: (.text+0x1753): undefined reference to GSS_C_NT_HOSTBASED_SERVICE' /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libzmq.a(libzmq_la-gssapi_mechanism_base.o): in functionzmq::gssapi_mechanism_base_t::acquire_credentials(char*, gss_cred_id_struct*, gss_OID_desc_struct)': (.text+0x17bc): undefined reference to gss_import_name' /usr/bin/ld: (.text+0x17db): undefined reference togss_acquire_cred' /usr/bin/ld: (.text+0x17ec): undefined reference to gss_release_name' /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libzmq.a(libzmq_la-gssapi_mechanism_base.o): in functionzmq::gssapi_mechanism_base_t::~gssapi_mechanism_base_t()': (.text+0x13d): undefined reference to gss_delete_sec_context' /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libzmq.a(libzmq_la-gssapi_mechanism_base.o): in functionzmq::gssapi_mechanism_base_t::~gssapi_mechanism_base_t()': (.text+0x18d): undefined reference to `gss_delete_sec_context' collect2: error: ld returned 1 exit status

moneromooo-monero commented 4 years ago

Your libzmq seems to need libgssapi. Try this:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2a16e0081..e688f7c1a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -969,6 +969,7 @@ find_path(ZMQ_INCLUDE_PATH zmq.h)
 find_library(ZMQ_LIB zmq)
 find_library(PGM_LIBRARY pgm)
 find_library(NORM_LIBRARY norm)
+find_library(GSSAPI_LIBRARY libgssapi_krb5)
 find_library(PROTOLIB_LIBRARY protolib)
 find_library(SODIUM_LIBRARY sodium)

@@ -984,6 +985,9 @@ endif()
 if(NORM_LIBRARY)
   set(ZMQ_LIB "${ZMQ_LIB};${NORM_LIBRARY}")
 endif()
+if(GSSAPI_LIBRARY)
+  set(ZMQ_LIB "${ZMQ_LIB};${GSSAPI_LIBRARY}")
+endif()
 if(PROTOLIB_LIBRARY)
   set(ZMQ_LIB "${ZMQ_LIB};${PROTOLIB_LIBRARY}")
 endif()
moneromooo-monero commented 4 years ago

patch -p1 Then paste the above patch Then ^D Then make again

ghost commented 4 years ago
cd monero 
git diff CMakeLists.txt
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2a16e0081..e688f7c1a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -969,6 +969,7 @@ find_path(ZMQ_INCLUDE_PATH zmq.h)
 find_library(ZMQ_LIB zmq)
 find_library(PGM_LIBRARY pgm)
 find_library(NORM_LIBRARY norm)
+find_library(GSSAPI_LIBRARY libgssapi_krb5)
 find_library(PROTOLIB_LIBRARY protolib)
 find_library(SODIUM_LIBRARY sodium)

@@ -984,6 +985,9 @@ endif()
 if(NORM_LIBRARY)
   set(ZMQ_LIB "${ZMQ_LIB};${NORM_LIBRARY}")
 endif()
+if(GSSAPI_LIBRARY)
+  set(ZMQ_LIB "${ZMQ_LIB};${GSSAPI_LIBRARY}")
+endif()
 if(PROTOLIB_LIBRARY)
  set(ZMQ_LIB "${ZMQ_LIB};${PROTOLIB_LIBRARY}")
 endif()

done, but still get the same error?

moneromooo-monero commented 4 years ago

Do you have files named libgssapi* in /usr somewhere ?

ghost commented 4 years ago

Do you have files named libgssapi* in /usr somewhere ?

No that file or folder in /usr/

moneromooo-monero commented 4 years ago

Including in subdirectories ? I'd expect /usr/lib or /usr/lib64 or somesuch.

ghost commented 4 years ago

Including in subdirectories ? I'd expect /usr/lib or /usr/lib64 or somesuch.

i use "find libgssapi" command,No results.

moneromooo-monero commented 4 years ago

That will only find a file by that name. Try:

find /usr -name libgssapi\*

ghost commented 4 years ago

That will only find a file by that name. Try:

find /usr -name libgssapi*

/usr/lib/x86_64-linux-gnu/samba/libgssapi-samba4.so.2.0.0 /usr/lib/x86_64-linux-gnu/samba/libgssapi-samba4.so.2 /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so /usr/lib/x86_64-linux-gnu/mit-krb5/libgssapi_krb5.so /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2.2 /usr/share/doc/libgssapi-krb5-2 /usr/share/lintian/overrides/libgssapi-krb5-2

moneromooo-monero commented 4 years ago

grep GSSAPI build/...../release/CMakeCache.txt

(replacing the .... with what matches your system, probably Linux/master)

ghost commented 4 years ago
~/monero/build/Linux/master/release$
 grep GSSAPI CMakeCache.txt
GSSAPI_LIBRARY:FILEPATH=GSSAPI_LIBRARY-NOTFOUND
moneromooo-monero commented 4 years ago

Oh, my bad. Replace

find_library(GSSAPI_LIBRARY libgssapi_krb5) with: find_library(GSSAPI_LIBRARY gssapi_krb5)

ghost commented 4 years ago

Success ! really thank you!

moneromooo-monero commented 4 years ago

np, now in https://github.com/monero-project/monero/pull/6824