C clang can't find headers in /usr/local/include

I've just installed FreeBSD 12.1 a few days ago, and have run into a slight issue, mainly that without -I/usr/local/include clang (cc/c++) doesn't look for header files in /usr/local/include, even though that seems to be the location that most of them go. On the other hand, gcc/g++ is quite happy to look there without any additional flags. Is this intentional, or is it something that should be corrected? e.g.

Bash:
$ uname -a

FreeBSD fbsd.localnet 12.1-RELEASE FreeBSD 12.1-RELEASE r354233 GENERIC  i386
$ ls
example.c
$ cat example.c
#include <yaml.h>
int main() { return 0; }
$ #yaml.h is only found in /usr/local/include:
$ ls /usr/include/yaml.h
ls: /usr/include/yaml.h: No such file or directory
$ ls /usr/local/include/yaml.h
/usr/local/include/yaml.h
$ #clang (cc) can't find yaml.h without a -I/usr/local/include:
$ clang example.c -o example
example.c:1:10: fatal error: 'yaml.h' file not found
#include <yaml.h>
         ^~~~~~~~
1 error generated.
$ #but gcc can
$ gcc example.c -o example
$ ls
example example.c
$
 
Back
Top