2

我在让 pread() 在头文件中工作时遇到了一些麻烦。每次我编译程序时,它都会告诉我有一个因为语句#define _XOPEN_SOURCE 500。错误是:

In file included from networking.h:6,
                 from networking.c:1:
/usr/include/bsd/stdlib.h:47: error: expected ‘)’ before ‘*’ token
make: *** [all] Error 1

头文件中的头文件是

#ifndef NETWORKING_H
#define NETWORKING_H

#define _XOPEN_SOURCE 500

#include<bsd/stdlib.h>
#include<netinet/in.h>
#include<sys/errno.h>
#include<sys/types.h>
#include<sys/socket.h>

#include<ctype.h>
#include<fcntl.h>
#include<limits.h>
#include<netdb.h>
#include<pwd.h>
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
#include<unistd.h>

#include"html.h"

谢谢!

#ifndef LIBBSD_STDLIB_H
#define LIBBSD_STDLIB_H

#include <sys/cdefs.h>
#include <sys/stat.h>
#include <stdint.h>
#include <stdlib.h>

/* For compatibility with NetBSD, which defines humanize_number here. */
#include <libutil.h>

/* FIXME: Temporary inclusions to avoid API breakage, will be removed soon. */
#include <bsd/stdio.h>
#include <bsd/unistd.h>

__BEGIN_DECLS
u_int32_t arc4random();
void arc4random_stir();
void arc4random_addrandom(u_char *dat, int datlen);

int dehumanize_number(const char *str, int64_t *size);

char *getprogname ();
void setprogname (char *);
4

0 回答 0