build: building for just bench fails to link due to libevent symbols #18373

issue fanquake opened this issue on March 18, 2020
  1. fanquake commented at 3:46 AM on March 18, 2020: member

    Configuring to build only bench i.e: ./configure --with-gui=no --with-libs=no --with-utils=no --with-daemon=no --disable-tests currently fails to link with:

      CXXLD    bench/bench_bitcoin
    Undefined symbols for architecture x86_64:
      "_evhttp_uridecode", referenced from:
          urlDecode(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libbitcoin_util.a(libbitcoin_util_a-url.o)
      "_event_enable_debug_logging", referenced from:
          UpdateHTTPServerLogging(bool) in libbitcoin_server.a(libbitcoin_server_a-httpserver.o)
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

    Want to work on this issue?

    The purpose of the good first issue label is to highlight which issues are suitable for a new contributor without a deep understanding of the codebase.

    You do not need to request permission to start working on this. You are encouraged to comment on the issue if you are planning to work on it. This will help other contributors monitor which issues are actively being addressed and is also an effective way to request assistance if and when you need it.

    For guidance on contributing, please read CONTRIBUTING.md before opening your pull request.

  2. fanquake added the label Build system on Mar 18, 2020
  3. fanquake added the label good first issue on Mar 18, 2020
  4. brakmic commented at 8:58 AM on March 18, 2020: contributor

    I'll take this one.

  5. brakmic commented at 9:12 AM on March 18, 2020: contributor

    Btw. @fanquake ,

    While going through Makefile.bench.include I discovered this: $(EVENT_CLFAGS)

    This should certainly be $(EVENT_CFLAGS)

    Not sure if this would also be the solution to the actual problem as I'm still going through the Makefile, so I'd like to consult with you first before proposing anything.

  6. fanquake commented at 9:17 AM on March 18, 2020: member

    This should certainly be $(EVENT_CFLAGS)

    Good catch! In any case that should also be fixed.

  7. brakmic commented at 10:11 AM on March 18, 2020: contributor

    @fanquake , A possible fix could be done by using an explicit LDFLAG -levent as shown in my repo.

    But before I open a PR I also have another question: should we also remove the double LIBBITCOIN_SERVER from here. Not sure if we should open a new issue because of this.

    This already got removed from Makefile.am in #17910 so I suppose it would make sense to get rid of it here as well.

  8. MarcoFalke commented at 2:32 PM on March 18, 2020: member

    Yeah, if it compiles and links, it can be removed.

  9. brakmic commented at 2:33 PM on March 18, 2020: contributor

    Yeah, if it compiles and links, it can be removed.

    Yes, it does. Have tested it. Will then add it to this PR.

  10. brakmic cross-referenced this on Mar 18, 2020 from issue build: fix libevent linking errors for bench-only builds by brakmic
  11. hebasto cross-referenced this on Mar 21, 2020 from issue build: Fix libevent linking for bench_bitcoin binary by hebasto
  12. fanquake closed this on Mar 26, 2020

  13. sidhujag referenced this in commit af0f536a13 on Mar 28, 2020
  14. bitcoin locked this on Feb 15, 2022
  15. knst referenced this in commit b0109f01f2 on May 25, 2023
  16. PastaPastaPasta referenced this in commit 8ae94ada7c on May 31, 2023

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-05-20 06:54 UTC