ffmpeg ubuntu18.04编译报错fcntl64

fcntl,fcntl64均是系统的api提供的文件操作,fcntl64本来是用来解决操作大文件的问题,后面fcntl本身已经解决了这个问题,fcntl64就被舍弃了

系统环境信息:

ubuntu 18.04

root@# cat /etc/issue
Ubuntu 18.04.6 LTS \n \l

root@alg-dev04:~# uname -a
Linux alg-dev04 4.15.0-151-generic #157-Ubuntu SMP Fri Jul 9 23:07:57 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

root@alg-dev04:~# lscpu
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              8
On-line CPU(s) list: 0-7
Thread(s) per core:  1
Core(s) per socket:  1
Socket(s):           8
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               85
Model name:          Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz
Stepping:            4
CPU MHz:             2294.608
BogoMIPS:            4589.21
L1d cache:           32K
L1i cache:           32K
L2 cache:            1024K
L3 cache:            25344K
NUMA node0 CPU(s):   0-7

为了按照需要开启ffmpeg的特定功能,需要源码安装ffmpeg

源码下载地址:

Download FFmpeg

wget https://ffmpeg.org/releases/ffmpeg-6.0.1.tar.bz2

tar -xvf ffmpeg-6.0.1.tar.bz2

./configure && make -j32

报错信息如下:

AR      libavcodec/libavcodec.a
LD      ffmpeg_g
LD      ffprobe_g
LD      ffplay_g
libavdevice/libavdevice.a(oss.o): In function `ff_oss_audio_open':
/root/xingqiao/ffmpeg-6.0.1/libavdevice/oss.c:63: undefined reference to `fcntl64'
libavformat/libavformat.a(network.o): In function `ff_socket':
/root/xingqiao/ffmpeg-6.0.1/libavformat/network.c:195: undefined reference to `fcntl64'
libavformat/libavformat.a(os_support.o): In function `ff_socket_nonblock':
/root/xingqiao/ffmpeg-6.0.1/libavformat/os_support.c:221: undefined reference to `fcntl64'
/root/xingqiao/ffmpeg-6.0.1/libavformat/os_support.c:219: undefined reference to `fcntl64'
/root/xingqiao/ffmpeg-6.0.1/libavformat/os_support.c:221: undefined reference to `fcntl64'
libavformat/libavformat.a(file.o):/root/xingqiao/ffmpeg-6.0.1/libavformat/file.c:208: more undefined references to `fcntl64' follow
libavdevice/libavdevice.a(oss.o): In function `ff_oss_audio_open':
/root/xingqiao/ffmpeg-6.0.1/libavdevice/oss.c:63: undefined reference to `fcntl64'
libavformat/libavformat.a(network.o): In function `ff_socket':
/root/xingqiao/ffmpeg-6.0.1/libavformat/network.c:195: undefined reference to `fcntl64'
libavformat/libavformat.a(os_support.o): In function `ff_socket_nonblock':
/root/xingqiao/ffmpeg-6.0.1/libavformat/os_support.c:221: undefined reference to `fcntl64'
/root/xingqiao/ffmpeg-6.0.1/libavformat/os_support.c:219: undefined reference to `fcntl64'
/root/xingqiao/ffmpeg-6.0.1/libavformat/os_support.c:221: undefined reference to `fcntl64'
libavformat/libavformat.a(file.o):/root/xingqiao/ffmpeg-6.0.1/libavformat/file.c:208: more undefined references to `fcntl64' follow
libavdevice/libavdevice.a(oss.o): In function `ff_oss_audio_open':
/root/xingqiao/ffmpeg-6.0.1/libavdevice/oss.c:63: undefined reference to `fcntl64'
libavformat/libavformat.a(network.o): In function `ff_socket':
/root/xingqiao/ffmpeg-6.0.1/libavformat/network.c:195: undefined reference to `fcntl64'
libavformat/libavformat.a(os_support.o): In function `ff_socket_nonblock':
/root/xingqiao/ffmpeg-6.0.1/libavformat/os_support.c:221: undefined reference to `fcntl64'
/root/xingqiao/ffmpeg-6.0.1/libavformat/os_support.c:219: undefined reference to `fcntl64'
/root/xingqiao/ffmpeg-6.0.1/libavformat/os_support.c:221: undefined reference to `fcntl64'
libavformat/libavformat.a(file.o):/root/xingqiao/ffmpeg-6.0.1/libavformat/file.c:208: more undefined references to `fcntl64' follow
collect2: error: ld returned 1 exit status
Makefile:131: recipe for target 'ffmpeg_g' failed
make: *** [ffmpeg_g] Error 1
make: *** Waiting for unfinished jobs....
collect2: error: ld returned 1 exit status
Makefile:131: recipe for target 'ffprobe_g' failed

调整配置命令也是无效:调整为gcc8,无法解决问题

./configure --cc=gcc-8 --enable-static --disable-shared --extra-libs=-lc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-asm --enable-pic --disable-x86asm --extra-ldflags="-Wl,--no-as-needed,-rpath=/usr/lib/gcc/x86_64-linux-gnu/8" --target-os=linux --arch=x86_64 --extra-cxxflags="-fPIC" --ignore-tests --enable-debug=3

root@alg-dev04:~# ldd --version
ldd (GNU libc) 2.29
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
root@alg-dev04:~# 

理论上来说的话,glibc的库的这个版本应该是兼容fcntl64的

编译器版本:

root@alg-dev04:~# gcc --version
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

查看源码 是否包含相应的fcntl64的代码调用:发现只有中间文件存在,源码并没有

root@alg-dev04:~/xingqiao/ffmpeg-6.0.1# grep -lr "fcntl64" ./
./libavformat/libavformat.a
./libavformat/network.o
./libavformat/os_support.o
./libavformat/file.o
./libavdevice/libavdevice.a
./libavdevice/oss.o
./libavutil/file_open.o
./libavutil/libavutil.a

猜测应该是ffmpeg的某些依赖库调用了fcntl64,如此的话,重点就是分析glibc的是否真的存在fcntl64

但是全局搜索发现存在多个glibc的库,不知道ldd默认调用的是哪个,查看默认路径下的

root@alg-dev04:~/xingqiao# nm -D /lib/x86_64-linux-gnu/libc.so.6 | grep GLIBC
0000000000000000 A GLIBC_2.10
0000000000000000 A GLIBC_2.11
0000000000000000 A GLIBC_2.12
0000000000000000 A GLIBC_2.13
0000000000000000 A GLIBC_2.14
0000000000000000 A GLIBC_2.15
0000000000000000 A GLIBC_2.16
0000000000000000 A GLIBC_2.17
0000000000000000 A GLIBC_2.18
0000000000000000 A GLIBC_2.2.5
0000000000000000 A GLIBC_2.2.6
0000000000000000 A GLIBC_2.22
0000000000000000 A GLIBC_2.23
0000000000000000 A GLIBC_2.24
0000000000000000 A GLIBC_2.25
0000000000000000 A GLIBC_2.26
0000000000000000 A GLIBC_2.27
0000000000000000 A GLIBC_2.3
0000000000000000 A GLIBC_2.3.2
0000000000000000 A GLIBC_2.3.3
0000000000000000 A GLIBC_2.3.4
0000000000000000 A GLIBC_2.4
0000000000000000 A GLIBC_2.5
0000000000000000 A GLIBC_2.6
0000000000000000 A GLIBC_2.7
0000000000000000 A GLIBC_2.8
0000000000000000 A GLIBC_2.9
0000000000000000 A GLIBC_PRIVATE
root@alg-dev04:~/xingqiao# nm -D /lib/x86_64-linux-gnu/libc.so.6 | grep fcntl
0000000000110550 W __fcntl
0000000000110550 W fcntl

可见版本和ldd匹配,而且此库中并没有实现fcntl64,所以考虑升级glibc的版本,但是由于系统ubuntu18.04和此内核版本官方源提供的匹配版本就是如上的版本,尝试源码编译glibc库31版本,然后手动源码安装成功,ffmpeg可以编译成功,并且不会报错,但是切换到此路径下的glibc库的话,系统很多的命令都会报段错误,所以,glibc并不能如此的在系统下升级

最后的处理方案:

1.升级操作系统到Ubuntu 20.04.3 LTS,如此可以解决问题

2.使用docker镜像隔离,选择docker ubuntu:latest最新的镜像,系统版本:

root@ubuntu-ffmpeg-cuda:/data# cat /etc/issue
Ubuntu 24.04 LTS \n \l
root@ubuntu-ffmpeg-cuda:/data# ldd --version
ldd (Ubuntu GLIBC 2.39-0ubuntu8.1) 2.39

遇到类似问题若有更好的方案请留言,非常感谢,而且并没有确认是哪个库引入的fcntl64,按照介绍64位新系统,大文件操作,fcntl已经OK了,并不需要调用fcntl64,但是GNU的库存在前向兼容问题

查看过:fcntl.h 通过调整ffmpeg编译的时候的宏定义并没有什么效果

vim /usr/local/include/fcntl.h

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/605510.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

java数据结构之数组系统了解

1.数组介绍 数组就是一个存储数据的容器,容器的长度固定、存储元素的数据类型固定。 跟变量加以区分:变量也可以存储数据,但是只能存一个值。当要存的数据比较多的时候,用变量就不方便了。我们就可以使用数组来存储。 1.1数组…

部分设计模式概述

单例模式 工厂模式 适配器模式 模板方法模式 策略模式 责任链 观察者模式(又叫发布订阅模式)

【项目学习01_2024.05.08_Day06】

学习笔记 5 新增课程5.1 需求分析5.1.1 业务流程5.1.2 数据模型 5.2 接口定义5.3 接口开发5.3.1 保存课程基本信息5.3.2 保存营销信息 5.4 接口测试 5 新增课程 5.1 需求分析 5.1.1 业务流程 5.1.2 数据模型 5.2 接口定义 5.3 接口开发 根据需求分析,新增课程表…

集成学习案例-幸福感预测

集成学习案例一 (幸福感预测) 背景介绍 此案例是一个数据挖掘类型的比赛——幸福感预测的baseline。比赛的数据使用的是官方的《中国综合社会调查(CGSS)》文件中的调查结果中的数据,其共包含有139个维度的特征&#xf…

特定消谐技术:SHEPWM调制方法

简介 特定消谐技术是通过计算PWM波的开关时刻,消除特定的低阶谐波。其基本理论是恰当地控制逆变器脉宽调制电压的波形,通过脉宽平均法把逆变器输出的方波电压转换成等效的正弦波,以消除某些特定的谐波。本文对特定谐波消除方法的基本原理进行…

新书速览|Rust编程与项目实战

掌握Rust编程基础和开发方法,实战网络编程、图像和游戏开发、数据分析项目 本书内容 Rust是一门系统编程语言,专注于安全,尤其是并发安全,它也是支持函数式、命令式以及泛型等编程范式的多范式语言。标准Rust在语法和性能上和标准…

前端项目加载离线的百度地图,利用工具进行切指定区域的地图影像,自定义图层getTilesUrl

百度地图在开发中我们经常使用,但是有些项目是需要在内网进行,这时候我们不得不考虑项目中一些功能需要请求外网静态资源,比如百度地图。只有把包下载到本地,才能让静态资源文件的正常的访问。 目录 获取百度地图开发秘钥 引入在…

OpenSPG docker 安装教程

文章目录 前言自述 一、OpenSPG1.介绍 二、安装步骤1.安装服务端2.客户端部署 前言 自述 我最近是想结合chatglm3-6b和知识图谱做一个垂直领域的技术规范的问答系统,过程中也遇到了很多困难,在模型微调上,在数据集收集整理上,在知…

Golang | Leetcode Golang题解之第69题x的平方根

题目&#xff1a; 题解&#xff1a; func mySqrt(x int) int {if x 0 {return 0}C, x0 : float64(x), float64(x)for {xi : 0.5 * (x0 C/x0)if math.Abs(x0 - xi) < 1e-7 {break}x0 xi}return int(x0) }

大数据之Hue中运行Sqoop常见的问题分析

Hue提供执行Sqoop命令的功能。 使用方法 与在终端执行Sqoop命令不同&#xff0c;在Hue中执行Sqoop命令&#xff0c;应该直接使用Sqoop的一级子命令。Sqoop在终端和Hue执行的区别 在终端执行 sqoop import \ --connect jdbc:oracle:thin:10.100.144.152:1521/ORACLE_DB \ --use…

Web API之DOM

DOM 一.认识DOM二.获取元素三.事件基础四.操作元素(1).改变元素内容(2).修改元素属性(str、herf、id、alt、title&#xff09;(3).修改表单属性(4).修改样式属性操作(5).小结 五.一些思想(1).排他思想(2).自定义属性的操作 六.节点操作1.认识2.节点层级关系3.创建和添加、删除、…

电子硬件设计-Xilinx FPGA/SoC前期功耗评估方法(1)

目录 1. 简介 2. 使用方法 2.1 设计输入 2.2 查看结果 3. 额外说明 4. 总结 1. 简介 XPE (Xilinx Power Estimator, 功耗估算器) 电子表格是一种功耗估算工具&#xff0c;用于项目的预设计和预实现阶段。 该工具可以帮助工程师进行架构评估、器件选择、合适的电源组件以…

SpringCloudAlibaba:4.3云原生网关higress的JWT 认证

概述 简介 JWT是一种用于双方之间传递安全信息的简洁的、URL安全的声明规范。 定义了一种简洁的&#xff0c;自包含的方法用于通信双方之间以Json对象的形式安全的传递信息&#xff0c;特别适用于分布式站点的单点登录&#xff08;SSO&#xff09;场景 session认证的缺点 1.安…

liunx命令行 带颜色

for i in {1..49}; do echo -e "\033[;${i}m 这是${i}的效果 oldboy\E[0M"; done

如何彻底将CAD或者Cadence卸载干净

最近因为升级软件需要先彻底删除这两个软件&#xff0c;发现无论如何都不能卸载干净&#xff0c;于是乎找到这样一个软件帮助卸载或查找剩余的软件残留&#xff1a; 官网&#xff1a;https://geekuninstaller.com 支持软件和 UWP 应用的卸载&#xff0c;查看软件注册表和安装目…

防爆地下水位自动监测设备

TH-DSW1随着科技的不断进步&#xff0c;地下水资源监测技术也在日新月异。防爆地下水位自动监测设备作为一种先进的水文监测工具&#xff0c;其应用不仅提高了水资源管理的效率&#xff0c;还为保障水资源安全提供了有力支撑。 一、防爆地下水位自动监测设备的优势 防爆地下水…

跨协议通讯无缝对接:Modbus-BACnet楼宇智能转换器深度解析

在现代化的建筑群里&#xff0c;智能楼宇管理系统如同神经系统&#xff0c;协调着各设备的运行。某大型商业综合体&#xff0c;集购物中心、办公区、酒店于一体&#xff0c;面对着来自不同供应商的设备&#xff0c;如何实现统一管理和高效通讯成了首要挑战。特别是其内部既有采…

UE5 FARFilter筛选器使用方法

UE5 查找资源时可以用FARFilter进行筛选&#xff0c;之前可以用ClassNames进行筛选&#xff0c;但是5.1之后就弃用这个属性改成ClassPaths属性 构造一个FTopLevelAssetPath对象需要两个FName参数&#xff0c;但是没找到应该传什么 查找官方文档&#xff0c;明显是错误的&#x…

基于SSM的“小型企业人事管理系统”的设计与实现(源码+数据库+文档+PPT)

基于SSM的“小型企业人事管理系统”的设计与实现&#xff08;源码数据库文档PPT) 开发语言&#xff1a;Java 数据库&#xff1a;MySQL 技术&#xff1a;SSM 工具&#xff1a;IDEA/Ecilpse、Navicat、Maven 系统展示 系统功能结构图 登录界面 个人信息页面 用户打卡页面 扣…

Docker 入门篇(七)-- Docker 安装 nginx

引言 Docker 系列文章 Docker 入门篇&#xff08;一&#xff09;-- 简介与安装教程&#xff08;Windows和Linux&#xff09; Docker官方镜像 https://hub.docker.com/ 一、安装 nginx 1.安装环境 Linux 环境&#xff1a;centos 7docker 版本&#xff1a;26.1.0nginx版本&…