Chinaunix

标题: HP上g++编译问题 [打印本页]

作者: xfloat    时间: 2002-09-19 09:11
标题: HP上g++编译问题
最简单的测试程序
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
main()
{
       printf(\"hello world!\\n\";
}
然后用g++编译 显示错误如下
In file included from test.c:5:
/usr/include/sys/socket.h:484: syntax error before `(\' token
/usr/include/sys/socket.h:486: syntax error before `(\' token
用cc可以编译通过
484,486行如下
extern sbsize_t sendfile __((int, int, off_t, bsize_t,
                             const struct iovec *, int));
extern sbsize_t sendpath __((int, char *, off_t, bsize_t,
                             const struct iovec *, int));

什么原因呀?如何解决?


作者: xfloat    时间: 2002-09-19 09:20
补充:
HP Version: B.11.11
g++ Version  :3.1




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2