LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1485|回复: 9

找不到math.h文件(问题已解决)

[复制链接]
发表于 2006-6-19 11:35:32 | 显示全部楼层 |阅读模式
今天在编译MPlayer 1.0pre8出现了如下错误:
  1. m_option.c:9:18: error: math.h: No such file or directory
  2. m_option.c: In function 'parse_double':
  3. m_option.c:213: warning: incompatible implicit declaration of built-in function 'pow'
  4. make: *** [m_option.o] 错误 1
复制代码

因为此前曾经成功编译过Mplayer 1.0pre7,进入到Mplayer 1.0pre7的目录下,重新编译仍出现上述错误。
于是试着查找math.h的位置
  1. find /lib -name math.h
  2. find /usr -name math.h
  3. find / -name math.h
复制代码

均无法找到,看来是缺少库文件了,但是仍然百思不得甚解,因为以前能编译成功说明math.h文件是有的,而此后我并没有删除任何库文件(只是把KDE桌面环境卸载了,现在只用Gnome)。
现在想解决的问题是:
1、math.h 属于那个库
2、需要安装什么软件包才能恢复math.h
发表于 2006-6-19 13:18:35 | 显示全部楼层
回复 支持 反对

使用道具 举报

发表于 2006-6-19 14:56:43 | 显示全部楼层
yum install math.h 就可以了
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-6-20 07:30:53 | 显示全部楼层
楼上的方法不行,2楼的方法也不行呀
回复 支持 反对

使用道具 举报

发表于 2006-6-20 08:43:52 | 显示全部楼层
因為MPlayer-1.0pre8已經不支持gtk1.x, 需要wxGTK和wxPython的支持, 請到http://fedoraproject.org/extras/5/i386/ 目錄下載所需文件
回复 支持 反对

使用道具 举报

发表于 2006-6-20 11:10:49 | 显示全部楼层
#include <math.h>

编译时,gcc main.cpp -lm
即lib math 。
也可以将math库的位置添加到系统环境中,以后就不再需要-lm参数了。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-6-20 12:57:34 | 显示全部楼层
Post by KinSprite
#include <math.h>

编译时,gcc main.cpp -lm
即lib math 。
也可以将math库的位置添加到系统环境中,以后就不再需要-lm参数了。
我在机器上找不到math.h这个文件
回复 支持 反对

使用道具 举报

发表于 2006-6-20 15:08:06 | 显示全部楼层
装这个包:glibc-headers
编译mplayer是一件出力不讨好的事
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-6-20 18:35:38 | 显示全部楼层
Post by cobranail
装这个包:glibc-headers
编译mplayer是一件出力不讨好的事
用rpm -ql glibc-headers | grep math.h找到math.h在/usr/include下,但是进入该目录却找不到math.h,看来只有重装一下glibc-headers
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-6-20 20:19:47 | 显示全部楼层
找了个glibc-heads的包把math.h直接拷到/usr/include/下,居然把mplayer编译成功了
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表