免费注册 查看新帖 |

Chinaunix

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

[求助]关于SCO下编译多线程的问题? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-07-16 17:57 |只看该作者 |倒序浏览
我在SCO5.0.7(已经装了mp3和FSUpthread 3.5c)下编译一个简单的测试程序(linux 下正常),编译命令如下:gcc pthtest.c -o pthtest -lgthreads,结果报告如下错误:
In file included from /usr/include/pthread.h:40,
                 from pthtest.c:4:
/usr/include/pthread/signal.h:101: redefinition of `struct timespec'
In file included from pthtest.c:4:
/usr/include/pthread.h:177: conflicting types for `pthread_mutex_t'
/usr/include/sys/types.h:432: previous declaration of `pthread_mutex_t'
/usr/include/pthread.h:185: conflicting types for `pthread_mutexattr_t'
/usr/include/sys/types.h:386: previous declaration of `pthread_mutexattr_t'
/usr/include/pthread.h:240: conflicting types for `pthread_once_t'
/usr/include/sys/types.h:500: previous declaration of `pthread_once_t'
/usr/include/pthread.h:252: conflicting types for `pthread_cond_t'
/usr/include/sys/types.h:460: previous declaration of `pthread_cond_t'
/usr/include/pthread.h:256: conflicting types for `pthread_condattr_t'
/usr/include/sys/types.h:380: previous declaration of `pthread_condattr_t'
/usr/include/pthread.h:310: conflicting types for `pthread_attr_t'
/usr/include/sys/types.h:375: previous declaration of `pthread_attr_t'
/usr/include/pthread.h:320: conflicting types for `pthread_key_t'
/usr/include/sys/types.h:493: previous declaration of `pthread_key_t'
/usr/include/pthread.h:386: conflicting types for `pthread_t'
/usr/include/sys/types.h:247: previous declaration of `pthread_t'

大概是说sys/types.h 与pthread.h的定义重复,结果郁闷了好几天都解决不了,请诸位高人帮帮忙,小弟感激不尽

论坛徽章:
0
2 [报告]
发表于 2005-07-16 18:58 |只看该作者

[求助]关于SCO下编译多线程的问题?

设置下LD_LIBRARY_PATH

论坛徽章:
0
3 [报告]
发表于 2005-07-16 19:19 |只看该作者

[求助]关于SCO下编译多线程的问题?

[quote]原帖由 "chestnut king"]设置下LD_LIBRARY_PATH[/quote 发表:

请问具体怎么设置?是在gcc 下添加 libgthread.a 的路径吗?我装过FSUpthread 3.9,不过都是一样错误,后来嫌弃麻烦(每次编译都要加 -L/usr/local/include -I/usr/local/lib)删了,现在Mysql都装不上了

小弟是新手,万望各位多多指教!

论坛徽章:
0
4 [报告]
发表于 2005-07-17 22:39 |只看该作者

[求助]关于SCO下编译多线程的问题?

没什么人气啊 ,自己顶一下,呵呵!

论坛徽章:
0
5 [报告]
发表于 2005-07-25 16:47 |只看该作者

[求助]关于SCO下编译多线程的问题?

真是人微言轻啊!还是自己解决了

论坛徽章:
0
6 [报告]
发表于 2005-07-25 16:53 |只看该作者

[求助]关于SCO下编译多线程的问题?

/etc/ld.so.conf文件里面加上你的lib的路径
然后ldconfig

是这样的么?
好象这样就可以不用每次都用L来指定lib的地址了

论坛徽章:
0
7 [报告]
发表于 2005-07-25 17:28 |只看该作者

[求助]关于SCO下编译多线程的问题?

原帖由 "luojiannx" 发表:
/etc/ld.so.conf文件里面加上你的lib的路径
然后ldconfig

是这样的么?
好象这样就可以不用每次都用L来指定lib的地址了


谢谢了,坛子里还是有不少热心的朋友的。
  SCO Openserver下好像没有这个文件,我一般都是在.profile中添加LD_LIBRARY_PATH的。
   我发现好像是MP3的问题,没装MP3之前types.h是8K,装了后是13K。后来我卸载了MP3,装上MP1,就一切正常了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP