LinuxSir.cn,穿越时空的Linuxsir!

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

使用mpeg4的音频编码器为何出错阿(undefined reference to `pow')

[复制链接]
发表于 2004-2-19 15:32:48 | 显示全部楼层 |阅读模式
首先安装faac编码器
但是在编译连接时出错阿

#include <unistd.h>
int main(void)
{
  unsigned long     *samples;
  unsigned long     *size;
  faacEncHandle                 handle;
  faacEncConfigurationPtr       config;
  handle = faacEncOpen(44100,
                       2,
                       samples,
                       size);
  if (handle == NULL) {
    return -1;
  }
  config = faacEncGetCurrentConfiguration(handle);
  faacEncSetConfiguration(handle, config);
  return 0;
}

gcc test.c -g -o test -lfaac

/usr/local/lib/libfaac.so: undefined reference to `log'
/usr/local/lib/libfaac.so: undefined reference to `cos'
/usr/local/lib/libfaac.so: undefined reference to `sin'
/usr/local/lib/libfaac.so: undefined reference to `pow'
/usr/local/lib/libfaac.so: undefined reference to `log10'
/usr/local/lib/libfaac.so: undefined reference to `asin'
collect2: ld returned 1 exit status


哪位知道阿 谢谢
发表于 2004-2-19 17:33:10 | 显示全部楼层
用gcc test.c -g -o test -lfaac -lm编译。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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