ffmpeg编译报XX file not found解决方法

话不多说,直接上基础代码:

#include<stdio.h>
#include<libavutil/log.h>

int main()
{
    av_log_set_level(AV_LOG_DEBUG);
    av_log(NULL, AV_LOG_DEBUG, "Hello world");
    return 0;
}

输入编译指令:

gcc test.c -o ttt `pkg-config --libs --cflags libavutil`

出现报错:

fatal error:libavutil/log.h:no such file or directory

具体解决办法:

(1)安装pkg-config

apt install pkg-config

在命令行终端输入pkg-config如果出现出现以下英文,证明安装成功

Must specify package names on the command line


(2)

gcc test.c -o test ' pkg-config --libs --cflags libavutil'

出现新的错误:

Package libavutil was not found in the pkg-config search path.
Perhaps you should add the directory co
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
这个错误提示是说在编译过程中找不到libavutil/time.h文件。根据引用,这个错误是由于缺少linux/perf_event.h文件导致的。可以根据引用中的方法,在libavutil目录下创建一个avconfig.h文件,然后在avconfig.h文件中添加以下内容: ``` /* Generated by ffconf */ #ifndef AVUTIL_AVCONFIG_H #define AVUTIL_AVCONFIG_H #define AV_HAVE_BIGENDIAN 0 #define AV_HAVE_FAST_UNALIGNED 0 #endif /* AVUTIL_AVCONFIG_H */ ``` 如果问题仍然存在,可以尝试根据引用中的方法进行操作。具体步骤是进入/ijkplayer-master/config目录,查看module-default.sh文件的最后一行是否包含以下内容: ``` export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --disable-linux-perf" ``` 如果没有的话,可以手动添加这一行。然后执行以下命令: ``` cd config rm module.sh ln -s module-lite.sh module.sh ``` 这样应该能解决缺少libavutil/time.h文件的错误。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [/libavutil/timer.h:38:31: fatal error: linux/perf_event.h: No such file or directory](https://blog.csdn.net/wusejiege6/article/details/108310915)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] - *2* [fatal error: libavutil/avconfig.h: No such file...](https://blog.csdn.net/athrunsunny/article/details/122369052)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值