Implicit declaration of scandir; alphasort is undeclared
问题 I am trying to use scandir to print a list of files in the current directory. When I try to compile, I am receiving the following errors and warnings: warning: implicit declaration of function ‘scandir’ [-Wimplicit-function-declaration] error: ‘alphasort’ undeclared (first use in this function) note: each undeclared identifier is reported only once for each function it appears in I am including <dirent.h> , which to my knowledge should define scandir() and all related functions. And I don't