【发布时间】:2013-07-19 09:12:11
【问题描述】:
我有 2 台装有 Ubuntu 12.04.2 LTS (64 mb) 的机器,另一台是雪豹操作系统。 在我的 Mac 中,我使用 ffmpeg 没有任何问题,但随后我尝试在 ubuntu 中使用 ffmpeg,出现 6700(!)错误:
error: undefined reference to `av_freep'
error: undefined reference to `av_strstart'
error: undefined reference to `av_freep'
...
我使用 QT 4.8.5 和 g++ x86 64b 我在http://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide 之后安装了ffmpeg,没有出现错误或警告。
我的测试代码是:
.h
QT += core gui
INCLUDEPATH += \
/usr/local/Include
LIBS += /usr/local/lib/libavcodec.a
LIBS += /usr/local/lib/libavutil.a
LIBS += /usr/local/lib/libavformat.a
LIBS += /usr/local/lib/libswscale.a
SOURCES += main.cpp
.cpp:
extern "C"
{
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
}
#include <stdio.h>
int main()
{
AVFormatContext *pFormatCtx;
av_register_all();
const char* fil = "/home/cits/Desktop/movFile.mov";
if(avformat_open_input(&pFormatCtx, fil, NULL, NULL)!=0)
{
return -1; // Couldn't open file
}
if(avformat_find_stream_info(pFormatCtx, NULL)<0)
{
return -1; // Couldn't find stream information
}
return 0;
}
有什么想法吗??
提前致谢。
【问题讨论】: