joncampbell123/dosbox-x

Building dosbox-x with debug under MacOS 14.6.1

Opened this issue · 2 comments

Question

Building failed with error:

Undefined symbols for architecture x86_64:
  "_slirp_add_hostfwd", referenced from:
      SlirpEthernetConnection::SetupPortForwards(bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) in libmisc.a[6](ethernet_slirp.o)
  "_slirp_cleanup", referenced from:
      SlirpEthernetConnection::~SlirpEthernetConnection() in libmisc.a[6](ethernet_slirp.o)
  "_slirp_input", referenced from:
      SlirpEthernetConnection::SendPacket(unsigned char const*, int) in libmisc.a[6](ethernet_slirp.o)
  "_slirp_new", referenced from:
      SlirpEthernetConnection::Initialize(Section*) in libmisc.a[6](ethernet_slirp.o)
  "_slirp_pollfds_fill", referenced from:
      SlirpEthernetConnection::GetPackets(std::__1::function<void (unsigned char const*, int)>) in libmisc.a[6](ethernet_slirp.o)
  "_slirp_pollfds_poll", referenced from:
      SlirpEthernetConnection::GetPackets(std::__1::function<void (unsigned char const*, int)>) in libmisc.a[6](ethernet_slirp.o)
  "_slirp_remove_hostfwd", referenced from:
      SlirpEthernetConnection::Initialize(Section*) in libmisc.a[6](ethernet_slirp.o)
      SlirpEthernetConnection::Initialize(Section*) in libmisc.a[6](ethernet_slirp.o)
      SlirpEthernetConnection::ClearPortForwards(bool, std::__1::map<int, int, std::__1::less<int>, std::__1::allocator<std::__1::pair<int const, int>>>&) in libmisc.a[6](ethernet_slirp.o)
  "_slirp_version_string", referenced from:
      SlirpEthernetConnection::Initialize(Section*) in libmisc.a[6](ethernet_slirp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocatio

I already install packages as here: https://github.com/joncampbell123/dosbox-x/blob/master/.github/workflows/macos.yml

and start ./build-debug-macos.

Tried to add this fix to the build script:

new="-framework CoreFoundation -framework Carbon "
export LDFLAGS="$new$LDFLAGS"

but nothing helps.

Have you checked that no similar question(s) exist?

  • I have searched and didn't find any similar question.

Code of Conduct & Contributing Guidelines

  • I agree to follow the code of conduct and the contributing guidelines.

I don't have macOS 14 to test, but you may try (re-)installing libslirp manually.
Building on macOS 13 (Ventura) working fine here, as well as github CI runner.

I don't know what your intention was for the items you added to LDFLAG, but definitely you must at least add something related to libslirp, which is quite obvious from the log you showed.

The following I picked up from the log of the nightly builds.

-L/usr/local/Cellar/libslirp/4.8.0/lib  -lslirp

Considering your comment, I thought it better to add some explanation to install required libraries in the build instructions. (PR #5247)