newmacuser
newmacuser

Reputation: 21

ld linker is missing when installing gcc using Homebrew on Mac OS

I am a new Mac user and need to install GNU compilers (C and C++) and CMake for the code I am using.

I installed gcc and its binary utilities and CMake via Homebrew with the correct PATH to the executables (/usr/local/bin). However, compiling my code shows error messages regarding a missing linker.

It seems like installing gcc and binutils via Homebrew does not include ld linker. Does anyone know how to manually install ld (via Homebrew preferrably)?

Upvotes: 2

Views: 1889

Answers (1)

Ortomala Lokni
Ortomala Lokni

Reputation: 62456

According to Homebrew maintainer fxcoudert, we know that:

GNU binutils's ld does not support Darwin (macOS), and is thus not built [in the Homebrew package]

So you have to adapt your build script to use the macOS version of ld located in /usr/bin

Upvotes: 1

Related Questions