Failed to build Master on Linux due to writeffmpeg.c error

This is the log:
writeffmpeg error
I can’t figure out the problem, is it a library error or a source code bug?
My Libraries are up to date
System: Ubuntu 20.04.3
Any help would be appreciated, thanks in advance

@elbox01 I think it is best to strictly follow the official documents (Building Blender/Linux/Ubuntu - Blender Developer Wiki) and use the precompiled library to build Blender. Maybe someone will explain to you how to solve your problem in a better and different way, AFAIK using system libraries is not officially supported

Do you know what version of FFmpeg you are building against? I am using the n4.5-dev version, which I also built from source.

Thank you for taking the time to look at it.
I took @NiCapp advice and cleaned everything up then I forced ‘’ script to build ffmpeg from source.
Then did a rebuild from scratch, everything went fine without errors till it comes to linking the libraries, I get these errors:
build log.txt
@ldo ‘’ uses ffmpeg 4.4 source

I guess i forget updating cmake parameters after compiling ffmepeg, now everything is working perfect again.
Thank you for helping out @NiCapp @ldo.