In Linux, when a C/C++ library is installed through a package manager, the C/C++ compiler on the system is immediately able to find the installed library. I haven't used Intel Macs but this is definitely not the case in M1 Macs.
On M1 Macs, homebrew
package manager installs software and libraries under /opt
folder. It seems that clang
that comes with XCode is not able to recognize this path so each time I compile my program against a particular library, I need to specify the library path using compiler's appropriate flag.
Is there a way to make clang
compiler in M1 Macs recognize installed C/C++ library paths by default?