我搜索了dirent以找到C例程
find / -iregex ".*/dirent.h$" 2>/dev/null哪一个返回相同的序列
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/dirent.h
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/dirent.h
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/sys/dirent.h
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/usr/include/dirent.h如何确保我的程序调用的是哪个dirent.h?
发布于 2018-11-10 19:26:12
如果您让编译器在预处理后向您显示代码,您应该能够计算出来。
因此,例如,使用gcc,您可以编写一个标称的program.c
#include <dirent.h>
main(int argc, char **argv){
return 0;
}然后跑:
gcc -E program.c研究它包含了什么。
相关的有用信息here。
https://stackoverflow.com/questions/53240152
复制相似问题