skip to Main Content

Recently, I upgraded to Xcode 15, and with that the update of the xcodebuild tools. However, suddenly, my standalone C++ applications are not able to use the g++-13 compiler for some reason? Anyone knows what might work, I don’t want to downgrade to Xcode 14.

2

Answers


  1. From Apple’s internal employees, this is the fault of Homebrew, you can either wait for Homebrew to fix it or try other ways to install GNU tools.

    Login or Signup to reply.
  2. The Homebrew team responded to the GitHub issue ld: warning: ignoring duplicate libraries: ‘-lemutls_w’, ‘-lgcc’ #4794 on Sep 19, 2023, with:

    "Yes, this is an incompatibility of current gcc with the Xcode 15 and/or CLT 15. The warning is not a problem, and we will ship a fixed version in the future."

    A commenter asked here on SO:

    Is it safe to ignore the warnings?
    (from a commenter)

    Yes. To get rid of the warnings, what worked for me was the suggestion to add the following linker flags for gcc:

    -Wl,-ld_classic
    

    ld_classic is the old Mach object file link editor.

    The ld_classic command combines several Mach-O (Mach object) files into one by combining like sections in like segments from all the object files, resolving external references, and searching libraries. In the simplest case several object files are given, and ld_classic combines them, producing an object file which can either be executed or become the input for a further ld_classic run. (In the latter case, the -r option must be given to preserve the relocation information.) Unless an output file is specified, ld_classic produces a file named a.out. This file is made executable only if no errors occurred during the link editing and there are no undefined symbols.

    (excerpt from man page)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search