Error with compiling

Hi guys.

I have a header file: unp.h like this:

#ifndef _UNP_H_
#define _UNP_H_

extern ssize_t readn(int filedes, void *buff, size_t nbytes);
extern ssize_t writen(int filedes, const void *buff, size_t nbytes);
extern void err_quit(const char *msg);

#define TRUE 1
#define FALSE 0

#define MAXLINE 4096

#endif /* _UNP_H_ */

and i have implemented readn, writen, err_quit functions in unp.c file. also i have included unp.h in other .c files to use these functions. But when I want to compile gcc says:

unp.h:4: error: expected �=', �,', �;', �asm' or �__attribute__' before �readn'
unp.h:5: error: expected �=', �,', �;', �asm' or �__attribute__' before �writen'

Could anyone help me?

ssize_t is not a built-in type - I believe you'll get it if you #include <stddef.h>.

EDIT: No, my bad - stddef.h is just for size_t - the signed variant is only POSIX, so it's in <sys/types.h>.

1 Like

thank you very much.
God Bless This Forum.