Linux C 编译错误总结

1. test.c:59:5: warning: incompatible implicit declaration of built-in function ‘memset’ [enabled by default]

添加头文件: #include<string.h>, 解决。

2.implicit declaration of function ‘sleep’ [-Wimplicit-function-declaration

Because sleep isn't in time.h? It's in unistd.h, on *nix machines. 所以添加"#include <unistd.h>"解决

你可能感兴趣的:(linux)