问问题
1774 次
2 回答
2
You most likely have a typo or something simple wrong.....try this.
#include <unistd.h>
int
main()
{
int r;
r = unlink("foo");
return(r);
}
Compile it
gcc -Wall foo.c
Above should be a clean compile. You can pre-process and do a grep to verify that unlink declaration is pulled in.
sys> gcc -E foo.c | grep unlink
int unlink(const char *);
r = unlink("foo");
于 2013-11-15T18:04:58.570 回答
1
Referring your second issue ("implicit declaration of function sawb
"):
Replace
#ifndef __USE_XOPEN
#define __USE_XOPEN
#endif
with
#define _XOPEN_SOURCE
... placing it before all other #include
statements should make the prototyping for #include <unistd.h>
swab()
be available.
#define
s starting with a double underscore __
are reserved for internal use and shall not be set by a program directly.
于 2013-11-15T17:16:51.350 回答