首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >位于雪豹上的FFMpeg的libavformat在哪里?

位于雪豹上的FFMpeg的libavformat在哪里?
EN

Stack Overflow用户
提问于 2011-03-01 04:08:21
回答 1查看 2.3K关注 0票数 3

在获取makefile以查找.c程序的正确库和头文件方面有问题,我正在尝试编译。我正在尝试为苹果的HTTP流编译一个开源片段,它需要libavformat和其他FFMpeg库来编译。我使用Mac安装FFMpeg,当我在命令行中运行“哪个ffmpeg”时,它显示的目录是opt/local/bin/ffmpeg,但是在搜索之后,这个目录似乎不是带库的目录。

库似乎位于opt/local/include中,因为这是我看到头文件的地方。下面是带有可疑目录的makefile:

all: gcc -Wall -g live_segmenter.c -o live_segmenter -I/opt/local/bin -I/opt/local/include/libavutil -L/libavutil/-g/libavformat -libavformat -L/opt/ -libavcodec -L/opt/local/ -libavutil -L/opt/live_segmenter -libavcore -lbz2 -lz -lfaac -lmp3lame -lx264 -lfaad -lx264-lfaad

代码语言:javascript
复制
clean:
rm -f live_segmenter

下面是试图编译后的输出:

gcc -Wall -g live_segmenter.c -o live_segmenter -I/opt/local/bin - I/opt/local/include /libavutil -L/opt/local/include/libavformat -libavformat -L/opt/ -libavcodec -L/-libavcodec-L/ -libavutil -L/opt/local/include -libavcore -lbz2 -lz -lfaac -lmp3lame -lx264 -lfaad -lfaac-lfaad-lx264-lx264-lfaad-lx264-lfaad -lpthread

代码语言:javascript
复制
ld: library not found for -libavformat
collect2: ld returned 1 exit status
make: *** [all] Error 1

我还试着运行"ffmpeg -version“来查看ffmpeg的构建是否正确,而且似乎是这样,所以我对该做什么的想法已经用完了。任何帮助或指向正确的方向将是伟大的。谢谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-09-29 21:49:44

我认为你有太多的-I而没有足够的-L。来自gcc(1)关于狮子:

代码语言:javascript
复制
-I dir 
   Add the directory dir to the list of directories to be searched for 
   header files.  Directories named by -I are searched before the standard
   system include directories.  If the directory dir is a standard system 
   include directory, the option is ignored to ensure that the default
   search order for system directories and the special treatment of system
   headers are not defeated.

 -L dir
   Add directory dir to the list of directories to be searched for -l.

-l<libname>是一个链接器指令,它告诉ld在-L目录列表中的任何位置包含lib<libname>

试一试,而不是:

gcc -Wall -g live_segmenter.c -o live_segmenter -I/opt/local/include -L/opt/local/lib -lavcodec -lavutil -lavcore -lbz2 -lm -lz -lfaac -lmp3lame -lx264 -lfaad -lpthread

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5150365

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档