APUE程序清单11-4(线程清理处理程序)编译通不过,请教原因
时间:2011-02-28
来源:互联网
APUE程序清单11-4(线程清理处理程序)编译通不过,请教原因。
下面是出错提示:
sample11_4.c:19: error: expected identifier or ‘(’ before ‘while’
sample11_4.c:19: error: expected declaration specifiers or ‘...’ before ‘&’ token
sample11_4.c:19: warning: data definition has no type or storage class
sample11_4.c:19: error: conflicting types for ‘__pthread_unregister_cancel’
/usr/include/pthread.h:664: error: previous declaration of ‘__pthread_unregister_cancel’ was here
sample11_4.c:19: error: expected identifier or ‘(’ before ‘if’
sample11_4.c:19: error: expected identifier or ‘(’ before ‘}’ token
sample11_4.c:19: error: expected identifier or ‘(’ before ‘while’
sample11_4.c:21: error: expected identifier or ‘(’ before ‘return’
sample11_4.c:22: error: expected identifier or ‘(’ before ‘}’ token
[fsb@fu sample11_4]$ gcc -o sample11_4 sample11_4.c error.c -lpthread
sample11_4.c:19: error: expected identifier or ‘(’ before ‘while’
sample11_4.c:19: error: expected declaration specifiers or ‘...’ before ‘&’ token
sample11_4.c:19: warning: data definition has no type or storage class
sample11_4.c:19: error: conflicting types for ‘__pthread_unregister_cancel’
/usr/include/pthread.h:664: error: previous declaration of ‘__pthread_unregister_cancel’ was here
sample11_4.c:19: error: expected identifier or ‘(’ before ‘if’
sample11_4.c:19: error: expected identifier or ‘(’ before ‘}’ token
sample11_4.c:19: error: expected identifier or ‘(’ before ‘while’
sample11_4.c:20: error: expected identifier or ‘(’ before ‘do’
sample11_4.c:20: error: expected identifier or ‘(’ before ‘while’
sample11_4.c:20: error: expected identifier or ‘(’ before ‘}’ token
sample11_4.c:20: error: expected identifier or ‘(’ before ‘while’
sample11_4.c:20: error: expected declaration specifiers or ‘...’ before ‘&’ token
sample11_4.c:20: warning: data definition has no type or storage class
sample11_4.c:20: error: conflicting types for ‘__pthread_unregister_cancel’
/usr/include/pthread.h:664: error: previous declaration of ‘__pthread_unregister_cancel’ was here
sample11_4.c:20: error: expected identifier or ‘(’ before ‘if’
sample11_4.c:20: error: expected identifier or ‘(’ before ‘}’ token
sample11_4.c:20: error: expected identifier or ‘(’ before ‘while’
sample11_4.c:21: error: expected identifier or ‘(’ before ‘return’
sample11_4.c:22: error: expected identifier or ‘(’ before ‘}’ token
sample11_4.c:34: error: expected identifier or ‘(’ before ‘while’
sample11_4.c:34: error: expected declaration specifiers or ‘...’ before ‘&’ token
sample11_4.c:34: warning: data definition has no type or storage class
sample11_4.c:34: error: conflicting types for ‘__pthread_unregister_cancel’
/usr/include/pthread.h:664: error: previous declaration of ‘__pthread_unregister_cancel’ was here
sample11_4.c:34: error: expected identifier or ‘(’ before ‘if’
sample11_4.c:34: error: expected identifier or ‘(’ before ‘}’ token
sample11_4.c:34: error: expected identifier or ‘(’ before ‘while’
sample11_4.c:35: error: expected identifier or ‘(’ before ‘do’
sample11_4.c:35: error: expected identifier or ‘(’ before ‘while’
sample11_4.c:35: error: expected identifier or ‘(’ before ‘}’ token
sample11_4.c:35: error: expected identifier or ‘(’ before ‘while’
sample11_4.c:35: error: expected declaration specifiers or ‘...’ before ‘&’ token
sample11_4.c:35: warning: data definition has no type or storage class
sample11_4.c:35: error: conflicting types for ‘__pthread_unregister_cancel’
/usr/include/pthread.h:664: error: previous declaration of ‘__pthread_unregister_cancel’ was here
sample11_4.c:35: error: expected identifier or ‘(’ before ‘if’
sample11_4.c:35: error: expected identifier or ‘(’ before ‘}’ token
sample11_4.c:35: error: expected identifier or ‘(’ before ‘while’
sample11_4.c:36: error: expected declaration specifiers or ‘...’ before ‘(’ token
sample11_4.c:36: warning: data definition has no type or storage class
sample11_4.c:36: error: conflicting types for ‘pthread_exit’
/usr/include/pthread.h:234: error: previous declaration of ‘pthread_exit’ was here
sample11_4.c:37: error: expected identifier or ‘(’ before ‘}’ token
希望得到大家的指点,谢谢。
下面是出错提示:
sample11_4.c:19: error: expected identifier or ‘(’ before ‘while’
sample11_4.c:19: error: expected declaration specifiers or ‘...’ before ‘&’ token
sample11_4.c:19: warning: data definition has no type or storage class
sample11_4.c:19: error: conflicting types for ‘__pthread_unregister_cancel’
/usr/include/pthread.h:664: error: previous declaration of ‘__pthread_unregister_cancel’ was here
sample11_4.c:19: error: expected identifier or ‘(’ before ‘if’
sample11_4.c:19: error: expected identifier or ‘(’ before ‘}’ token
sample11_4.c:19: error: expected identifier or ‘(’ before ‘while’
sample11_4.c:21: error: expected identifier or ‘(’ before ‘return’
sample11_4.c:22: error: expected identifier or ‘(’ before ‘}’ token
[fsb@fu sample11_4]$ gcc -o sample11_4 sample11_4.c error.c -lpthread
sample11_4.c:19: error: expected identifier or ‘(’ before ‘while’
sample11_4.c:19: error: expected declaration specifiers or ‘...’ before ‘&’ token
sample11_4.c:19: warning: data definition has no type or storage class
sample11_4.c:19: error: conflicting types for ‘__pthread_unregister_cancel’
/usr/include/pthread.h:664: error: previous declaration of ‘__pthread_unregister_cancel’ was here
sample11_4.c:19: error: expected identifier or ‘(’ before ‘if’
sample11_4.c:19: error: expected identifier or ‘(’ before ‘}’ token
sample11_4.c:19: error: expected identifier or ‘(’ before ‘while’
sample11_4.c:20: error: expected identifier or ‘(’ before ‘do’
sample11_4.c:20: error: expected identifier or ‘(’ before ‘while’
sample11_4.c:20: error: expected identifier or ‘(’ before ‘}’ token
sample11_4.c:20: error: expected identifier or ‘(’ before ‘while’
sample11_4.c:20: error: expected declaration specifiers or ‘...’ before ‘&’ token
sample11_4.c:20: warning: data definition has no type or storage class
sample11_4.c:20: error: conflicting types for ‘__pthread_unregister_cancel’
/usr/include/pthread.h:664: error: previous declaration of ‘__pthread_unregister_cancel’ was here
sample11_4.c:20: error: expected identifier or ‘(’ before ‘if’
sample11_4.c:20: error: expected identifier or ‘(’ before ‘}’ token
sample11_4.c:20: error: expected identifier or ‘(’ before ‘while’
sample11_4.c:21: error: expected identifier or ‘(’ before ‘return’
sample11_4.c:22: error: expected identifier or ‘(’ before ‘}’ token
sample11_4.c:34: error: expected identifier or ‘(’ before ‘while’
sample11_4.c:34: error: expected declaration specifiers or ‘...’ before ‘&’ token
sample11_4.c:34: warning: data definition has no type or storage class
sample11_4.c:34: error: conflicting types for ‘__pthread_unregister_cancel’
/usr/include/pthread.h:664: error: previous declaration of ‘__pthread_unregister_cancel’ was here
sample11_4.c:34: error: expected identifier or ‘(’ before ‘if’
sample11_4.c:34: error: expected identifier or ‘(’ before ‘}’ token
sample11_4.c:34: error: expected identifier or ‘(’ before ‘while’
sample11_4.c:35: error: expected identifier or ‘(’ before ‘do’
sample11_4.c:35: error: expected identifier or ‘(’ before ‘while’
sample11_4.c:35: error: expected identifier or ‘(’ before ‘}’ token
sample11_4.c:35: error: expected identifier or ‘(’ before ‘while’
sample11_4.c:35: error: expected declaration specifiers or ‘...’ before ‘&’ token
sample11_4.c:35: warning: data definition has no type or storage class
sample11_4.c:35: error: conflicting types for ‘__pthread_unregister_cancel’
/usr/include/pthread.h:664: error: previous declaration of ‘__pthread_unregister_cancel’ was here
sample11_4.c:35: error: expected identifier or ‘(’ before ‘if’
sample11_4.c:35: error: expected identifier or ‘(’ before ‘}’ token
sample11_4.c:35: error: expected identifier or ‘(’ before ‘while’
sample11_4.c:36: error: expected declaration specifiers or ‘...’ before ‘(’ token
sample11_4.c:36: warning: data definition has no type or storage class
sample11_4.c:36: error: conflicting types for ‘pthread_exit’
/usr/include/pthread.h:234: error: previous declaration of ‘pthread_exit’ was here
sample11_4.c:37: error: expected identifier or ‘(’ before ‘}’ token
希望得到大家的指点,谢谢。
作者: fushaobing2010 发布时间: 2011-02-28
建议你把代码贴出来,不是所有人都有你说的这个代码
作者: dean_yanqing 发布时间: 2011-02-28
根据错误提示一个一个找,第一眼就感觉缺东少西,是不是环境没配置好?
作者: jiazhen 发布时间: 2011-02-28
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28