免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 2644 | 回复: 14
打印 上一主题 下一主题

gcc编译时库函数包含错误,help~~ [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-12-02 10:35 |只看该作者 |倒序浏览
一模一样的程序,一模一样的命令,师兄说他那里没问题
结果在我机器上就会出现下面的错误
#gcc -g -D_KERNEL -DSVR4 -DSOL2 -DOEBUG -O2 -c flkm.c
In file included from /usr/include/sys/reg.h:13,
                 from /usr/include/sys/pcb.h:11,
                 from /usr/include/sys/klwp.h:16,
                 from /usr/include/sys/thread.h:13,
                 from /usr/include/sys/copyops.h:12,
                 from /usr/include/sys/watchpoint.h:13,
                 from /usr/include/vm/as.h:37,
                 from /usr/include/sys/devops.h:16,
                 from /usr/include/sys/sunddi.h:18,
                 from flkm.c:19:
/usr/include/ia32/sys/reg.h:300: error: parse error before "upad128_t"
/usr/include/ia32/sys/reg.h:302: error: parse error before '}' token
/usr/include/ia32/sys/reg.h:309: error: field `kfpu_fx' has incomplete type
/usr/include/ia32/sys/reg.h:331: error: parse error before "upad128_t"
/usr/include/ia32/sys/reg.h:338: error: parse error before '}' token
/usr/include/ia32/sys/reg.h:339: error: parse error before '}' token
/usr/include/ia32/sys/reg.h:376: error: parse error before "fpregset_t"
In file included from /usr/include/sys/klwp.h:19,
                 from /usr/include/sys/thread.h:13,
                 from /usr/include/sys/copyops.h:12,
                 from /usr/include/sys/watchpoint.h:13,
                 from /usr/include/vm/as.h:37,
                 from /usr/include/sys/devops.h:16,
                 from /usr/include/sys/sunddi.h:18,
                 from flkm.c:19:
/usr/include/sys/ucontext.h:69: error: parse error before "mcontext_t"
/usr/include/sys/ucontext.h:71: error: parse error before '}' token

论坛徽章:
0
2 [报告]
发表于 2004-12-03 13:02 |只看该作者

gcc编译时库函数包含错误,help~~

up,up

论坛徽章:
0
3 [报告]
发表于 2004-12-03 13:36 |只看该作者

gcc编译时库函数包含错误,help~~

我也遇到了那个upad128的错误,正郁闷着呢,
同样等待大虾援手。

论坛徽章:
0
4 [报告]
发表于 2004-12-06 10:16 |只看该作者

gcc编译时库函数包含错误,help~~

继续up up:(不知道怎么回事,就是不行,简单的hello程序可以运行,gcc本身应该没问题,但是为什么reg.h和ucountext.h会出错呢

论坛徽章:
0
5 [报告]
发表于 2004-12-06 11:08 |只看该作者

gcc编译时库函数包含错误,help~~

包含头文件就会出错:(
头文件是
#include<sys/ddi.h>;
#include<sys/sunddi.h>;
就是简单的写一个hello程序之后前面加这两行也会出现一模一样的问题

论坛徽章:
0
6 [报告]
发表于 2004-12-29 23:16 |只看该作者

gcc编译时库函数包含错误,help~~

Perhaps likely the problem is that gcc does *not* use /usr/include/sys/types.h, but an old "fixed" version of that
file. For example with the gcc3 on Sun's software companion CD, it's using
/opt/sfw/gcc-3/lib/gcc-lib/i386-pc-solaris2.9/3.3.2/include/sys/types.h. And this version was "fixed" from an
old set of system header files, when upad128_t did not exist.
To solve this issue you need to re-run gcc's "fix-header" scripts. You have to build fresh "fixed" gcc header
files from the updated system header files, to get the system headers and gcc's fixed headers in sync.
For example:
/usr/local/libexec/gcc/i386-pc-solaris2.9/3.4.2/install-tools/mkheaders

论坛徽章:
0
7 [报告]
发表于 2004-12-30 09:32 |只看该作者

gcc编译时库函数包含错误,help~~

楼上的高手好劲!
学习!

论坛徽章:
0
8 [报告]
发表于 2004-12-30 10:26 |只看该作者

gcc编译时库函数包含错误,help~~

我编译JK2时也出现类似错误,照楼上说的试试。

论坛徽章:
0
9 [报告]
发表于 2005-01-03 21:10 |只看该作者

gcc编译时库函数包含错误,help~~

-D_KERNEL -DSVR4 -DSOL2 -DOEBUG这几个选项是什么意思?

论坛徽章:
0
10 [报告]
发表于 2005-01-03 22:28 |只看该作者

gcc编译时库函数包含错误,help~~

再复杂 也都是 头文件的事
原因就是 gcc 是装的 pkg 不是根据自己的机器编译而成的
人家 GNU 也不是白痴 早给我们预备好了解决方案 在下无意间发现
一个工具 专门修改头文件的 那就是
/usr/local/lib/????/install-tools/mkheaders
运行一下就可以修改大部分头文件 说出来给大家分享
不过这个真是不值得 单独发一个帖子说出来
呵呵
[yobbo] 怀疑他是 climbmount
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP