bitcoin-qt FTBFS : undefined reference to symbol 'shm_unlink@@GLIBC_2.2.5' #879

issue dooglus opened this issue on February 21, 2012
  1. dooglus commented at 10:31 AM on February 21, 2012: contributor

    Since updating archlinux i've been unable to build bitcoin-qt from git HEAD.

    The error is as follows:

    $ make g++ -m64 -Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu -fstack-protector -Wl,-O1 -o bitcoin-qt build/bitcoin.o [...] build/qrc_bitcoin.o -L/usr/lib -lqrencode -lminiupnpc -lssl -lcrypto -ldb_cxx -lboost_system -lboost_filesystem -lboost_program_options -lboost_thread -lQtGui -lQtCore -lpthread /usr/bin/ld: build/qtipcserver.o: undefined reference to symbol 'shm_unlink@@GLIBC_2.2.5' /usr/bin/ld: note: 'shm_unlink@@GLIBC_2.2.5' is defined in DSO /lib/librt.so.1 so try adding it to the linker command line /lib/librt.so.1: could not read symbols: Invalid operation collect2: ld returned 1 exit status make: *** [bitcoin-qt] Error 1 $

    I made the following change to bitcoin-qt.pro and the problem went away:

    LIBS += $$join(BOOST_LIB_PATH,,-L,) $$join(BDB_LIB_PATH,,-L,) $$join(OPENSSL_LIB_PATH,,-L,) $$join(QRENCODE_LIB_PATH,,-L,) -LIBS += -lssl -lcrypto -ldb_cxx$$BDB_LIB_SUFFIX +LIBS += -lssl -lcrypto -ldb_cxx$$BDB_LIB_SUFFIX -lrt

    -lgdi32 has to happen after -lcrypto (see #681)

    I don't know enough about what's going on to say whether that's a good idea, but it worked for me...

  2. laanwj commented at 10:39 AM on February 21, 2012: member

    Adding -rt should be done only for Linux, I suppose? It's strange that we'd have to link against it directly, as we don't use shm_open/shm_unlink directly, it is at most Boost using it.

  3. dooglus commented at 10:42 AM on February 21, 2012: contributor

    When trying to understand the change I found a link: http://fedoraproject.org/wiki/UnderstandingDSOLinkChange that claims to explain it.

    Hope that helps!

  4. dooglus commented at 10:49 AM on February 21, 2012: contributor

    The undefined symbol is referenced on line 374 of /usr/include/boost/interprocess/shared_memory_object.hpp, included by /usr/include/boost/interprocess/ipc/message_queue.hpp, included by bitcoin/src/qt/qtipcserver.cpp

  5. laanwj commented at 11:01 AM on February 21, 2012: member

    Yes, that makes it fully clear. We must link to -lrt on Linux, as previously we were using it indirectly through some other lib and that's no longer allowed...

  6. pio2398 commented at 6:31 AM on March 14, 2012: none

    On Fedora You fix help too.

  7. bitaussie commented at 6:34 AM on March 14, 2012: none

    Is that some kind of a stack-based language?

    Does changing "LIBS += -lssl -lcrypto -ldb_cxx$$BDB_LIB_SUFFIX" to "LIBS += -lssl -lcrypto -ldb_cxx$$BDB_LIB_SUFFIX -lrt" in bitcoin-qt.pro fix it on Fedora?

  8. laanwj commented at 6:42 AM on March 14, 2012: member

    Fixed now.

  9. laanwj closed this on Mar 14, 2012

  10. ptschip referenced this in commit d67331b847 on Jan 5, 2018
  11. dexX7 referenced this in commit 116d2126aa on Feb 13, 2019
  12. lateminer referenced this in commit 5f0d72659c on Oct 30, 2019
  13. sipa referenced this in commit c020cbaa5c on Jul 14, 2021
  14. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me