I am trying to build a project on Mac OS X using clang and it fails on linking step with ld: unknown option: --no-undefined
, which is meant to built with gcc.
What's the clang equivalent for this option? (Please, don't advise to use gcc instead of clang.)
Also, a more generic question, is there any resource where one can find some kind of a "mapping" between gcc and clang (linker) options differences?
Thank you.
OS X uses a different linker. As @rubenvb points out, it's probably the one from Apple's binutils. If you run man ld
, and search for "undefined", you will find this option:
-undefined treatment Specifies how undefined symbols are to be treated. Options are: error, warning, suppress, or dynamic_lookup. The default is error.
So, replace -Wl,--no-undefined
with -Wl,-undefined,error
. Also, use the Force, Luke.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With