The error messages suggest that the code is trying to access the "d_type" member of a "struct dirent", which does not exist. The code also references the "DT_DIR" and "DT_REG" constants, which are not defined.

This could be due to differences in the implementation of the dirent.h header file on different systems. Some systems may support the "d_type" member and the constants, while others may not.

To fix the error, you could try using a different approach to check whether a directory entry is a directory or a regular file. One option is to use the "stat" function to get information about the file, and then check the "st_mode" field to see if it represents a directory or a regular file. Another option is to use the "opendir" and "readdir" functions to iterate over the directory entries, and then use the "S_ISDIR" and "S_ISREG" macros to check if the entry is a directory or a regular file.

cc7417 error struct dirent has no member named d_type; did you mean d_name if dp-d_type == DT_DIR ^~~~~~ d_name cc7427 error DT_DIR undeclared first use in

原文地址: https://www.cveoy.top/t/topic/buaK 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录