0

I am learning from APUE3e

#include "apue.h"
#include <dirent.h>

int main(int argc, char *argv[])
{
    DIR *dp;
    struct dirent *dirp;
  ....

In the header, import a user-definded module "apue.h". the program run correctly after compiled.

The apue.h is placed in /Library/Developer/CommandLineTools/usr/include,

What confuse me is that /Library/Developer/CommandLineTools/usr/include is not in the $PATH but could be retrieved by the program globally.

$ echo $PATH | grep include
#does not return anything.

How could the program get it done?

AbstProcDo
  • 19,953
  • 19
  • 81
  • 138

1 Answers1

1

$PATH is where the shell looks for executables, not header files. This answer shows how you can get the compiler to show you where it's looking for header files.

Bruce Collie
  • 435
  • 3
  • 8