问题如下
$ ./configure --enable-shared --prefix=/usr/local/ffmpeg
gcc is unable to create an executable file.
If gcc is a cross-compiler, use the --enable-cross-compile option.
Only do this if you know what cross compiling means.
C compiler test failed.
If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.
点开/ffbuild/config.log,查看出错信息,出错信息为如下所示
/usr/bin/ld: cannot find crtbegin.o: No such file or directory
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: cannot find -lgcc_s
直接原因:找不到crtbegin文件所致,间接原因:gcc未配置好(猜得),
故在/usr下查找crtbegin
$ sudo find /usr/ -name crtbegin*
/usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o
/usr/lib/gcc/x86_64-linux-gnu/7/crtbeginT.o
/usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o
/usr/lib/gcc/x86_64-linux-gnu/5/crtbeginS.o
/usr/lib/gcc/x86_64-linux-gnu/5/crtbeginT.o
/usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o
可以看出usr文件内含有该文件,只要增加一个路径即可
我按装了两个版本的gcc,一个为gcc-7.4,一个为gcc-5.4.0,目前正在使用的版本为5.4,所以路径应该为/usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o
在ffmpeg目录下,打开终端
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5:$LIBRARY_PATH
export LIBRARY_PATH
再./configure后即可成功
注:configure成功后,make,make install时可能会再出现如下问题:
/usr/bin/ld: cannot find crtbeginS.o: No such file or directory
collect2: error: ld returned 1 exit status
解决方案就是,打开bashrc,
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5:$LIBRARY_PATH
export LIBRARY_PATH
```
把上面的路径再复制粘帖进去,重新make instal,大功告成!
参考博客
https://blog.csdn.net/happygogf/article/details/18147397
```cpp
$./configure --enable-shared --prefix=/usr/local/ffmpeg
install prefix /usr/local/ffmpeg
source path .
C compiler gcc
C library glibc
ARCH x86 (generic)
big-endian no
runtime cpu detection yes
standalone assembly yes
x86 assembler yasm
MMX enabled yes
MMXEXT enabled yes
3DNow! enabled yes
3DNow! extended enabled yes
SSE enabled yes
SSSE3 enabled yes
AESNI enabled yes
AVX enabled yes
AVX2 enabled yes
AVX-512 enabled yes
XOP enabled yes
FMA3 enabled yes
FMA4 enabled yes
i686 features enabled yes
CMOV is fast yes
EBX available yes
EBP available yes
debug symbols yes
strip symbols yes
optimize for size no
optimizations yes
static yes
shared yes
postprocessing support no
network support yes
threading support pthreads
safe bitstream reader yes
texi2html enabled no
perl enabled yes
pod2man enabled yes
makeinfo enabled yes
makeinfo supports HTML yes
External libraries:
alsa libxcb_shape sdl2
bzlib libxcb_shm sndio
iconv libxcb_xfixes xlib
libxcb lzma zlib
External libraries providing hardware acceleration:
v4l2_m2m vaapi vdpau
Libraries:
avcodec avformat swresample
avdevice avutil swscale
avfilter
Programs:
ffmpeg ffplay ffprobe
Enabled decoders:
aac atrac3p escape124
aac_fixed atrac3pal escape130
aac_latm aura evrc
aasc aura2 exr
ac3 avrn ffv1
ac3_fixed avrp ffvhuff
adpcm_4xm avs ffwavesynth
adpcm_adx avui fic
adpcm_afc ayuv fits
adpcm_aica bethsoftvid flac
adpcm_ct bfi flashsv
adpcm_dtk bink flashsv2
adpcm_ea binkaudio_dct flic
adpcm_ea_maxis_xa binkaudio_rdft flv
adpcm_ea_r1 bintext fmvc
adpcm_ea_r2 bitpacked fourxm
adpcm_ea_r3 bmp fraps
adpcm_ea_xas bmv_audio frwu
adpcm_g722 bmv_video g2m
adpcm_g726 brender_pix g723_1
adpcm_g726le c93 g729
adpcm_ima_amv cavs gdv
adpcm_ima_apc ccaption gif
adpcm_ima_dat4 cdgraphics gremlin_dpcm
adpcm_ima_dk3 cdxl gsm
adpcm_ima_dk4 cfhd gsm_ms
adpcm_ima_ea_eacs cinepak h261
adpcm_ima_ea_sead clearvideo h263
adpcm_ima_iss cljr h263_v4l2m2m
adpcm_ima_oki cllc h263i
adpcm_ima_qt comfortnoise h263p
adpcm_ima_rad cook h264
adpcm_ima_smjpeg cpia h264_v4l2m2m
adpcm_ima_wav cscd hap
adpcm_ima_ws cyuv hevc
adpcm_ms dca hnm4_video
adpcm_mtaf dds hq_hqa
adpcm_psx dfa hqx
adpcm_sbpro_2 dirac huffyuv
adpcm_sbpro_3 dnxhd iac
adpcm_sbpro_4 dolby_e idcin
adpcm_swf dpx idf
adpcm_thp dsd_lsbf iff_ilbm
adpcm_thp_le dsd_lsbf_planar imc
adpcm_vima dsd_msbf indeo2
adpcm_xa dsd_msbf_planar indeo3
adpcm_yamaha dsicinaudio indeo4
aic dsicinvideo indeo5
alac dss_sp interplay_acm
alias_pix dst interplay_dpcm
als dvaudio interplay_video
amrnb dvbsub jacosub
amrwb dvdsub jpeg2000
amv dvvideo jpegls
anm dxa jv
ansi dxtory kgv1
ape dxv kmvc
apng eac3 lagarith
aptx eacmv loco
aptx_hd eamad m101
ass eatgq mace3
asv1 eatgv mace6
asv2 eatqi magicyuv
atrac1 eightbps mdec
atrac3 eightsvx_exp metasound
atrac3al eightsvx_fib microdvd
mimic pcm_s24le smc
mjpeg pcm_s24le_planar smvjpeg
mjpegb pcm_s32be snow
mlp pcm_s32le sol_dpcm
mmvideo pcm_s32le_planar sonic
motionpixels pcm_s64be sp5x
movtext pcm_s64le speedhq
mp1 pcm_s8 srgc
mp1float pcm_s8_planar srt
mp2 pcm_u16be ssa
mp2float pcm_u16le stl
mp3 pcm_u24be subrip
mp3adu pcm_u24le subviewer
mp3adufloat pcm_u32be subviewer1
mp3float pcm_u32le sunrast
mp3on4 pcm_u8 svq1
mp3on4float pcm_zork svq3
mpc7 pcx tak
mpc8 pgm targa
mpeg1_v4l2m2m pgmyuv targa_y216
mpeg1video pgssub tdsc
mpeg2_v4l2m2m pictor text
mpeg2video pixlet theora
mpeg4 pjs thp
mpeg4_v4l2m2m png tiertexseqvideo
mpegvideo ppm tiff
mpl2 prores tmv
msa1 prores_lgpl truehd
mscc psd truemotion1
msmpeg4v1 ptx truemotion2
msmpeg4v2 qcelp truemotion2rt
msmpeg4v3 qdm2 truespeech
msrle qdmc tscc
mss1 qdraw tscc2
mss2 qpeg tta
msvideo1 qtrle twinvq
mszh r10k txd
mts2 r210 ulti
mvc1 ra_144 utvideo
mvc2 ra_288 v210
mxpeg ralf v210x
nellymoser rawvideo v308
nuv realtext v408
on2avc rl2 v410
opus roq vb
paf_audio roq_dpcm vble
paf_video rpza vc1
pam rscc vc1_v4l2m2m
pbm rv10 vc1image
pcm_alaw rv20 vcr1
pcm_bluray rv30 vmdaudio
pcm_dvd rv40 vmdvideo
pcm_f16le s302m vmnc
pcm_f24le sami vorbis
pcm_f32be sanm vp3
pcm_f32le sbc vp5
pcm_f64be scpr vp6
pcm_f64le screenpresso vp6a
pcm_lxf sdx2_dpcm vp6f
pcm_mulaw sgi vp7
pcm_s16be sgirle vp8
pcm_s16be_planar sheervideo vp8_v4l2m2m
pcm_s16le shorten vp9
pcm_s16le_planar sipr vp9_v4l2m2m
pcm_s24be smackaud vplayer
pcm_s24daud smacker vqa
wavpack wnv1 xpm
webp wrapped_avframe xsub
webvtt ws_snd1 xwd
wmalossless xan_dpcm y41p
wmapro xan_wc3 ylc
wmav1 xan_wc4 yop
wmav2 xbin yuv4
wmavoice xbm zero12v
wmv1 xface zerocodec
wmv2 xl zlib
wmv3 xma1 zmbv
wmv3image xma2
Enabled encoders:
a64multi jpeg2000 ppm
a64multi5 jpegls prores
aac ljpeg prores_aw
ac3 magicyuv prores_ks
ac3_fixed mjpeg qtrle
adpcm_adx mjpeg_vaapi r10k
adpcm_g722 mlp r210
adpcm_g726 movtext ra_144
adpcm_g726le mp2 rawvideo
adpcm_ima_qt mp2fixed roq
adpcm_ima_wav mpeg1video roq_dpcm
adpcm_ms mpeg2_vaapi rv10
adpcm_swf mpeg2video rv20
adpcm_yamaha mpeg4 s302m
alac mpeg4_v4l2m2m sbc
alias_pix msmpeg4v2 sgi
amv msmpeg4v3 snow
apng msvideo1 sonic
aptx nellymoser sonic_ls
aptx_hd opus srt
ass pam ssa
asv1 pbm subrip
asv2 pcm_alaw sunrast
avrp pcm_f32be svq1
avui pcm_f32le targa
ayuv pcm_f64be text
bmp pcm_f64le tiff
cinepak pcm_mulaw truehd
cljr pcm_s16be tta
comfortnoise pcm_s16be_planar utvideo
dca pcm_s16le v210
dnxhd pcm_s16le_planar v308
dpx pcm_s24be v408
dvbsub pcm_s24daud v410
dvdsub pcm_s24le vc2
dvvideo pcm_s24le_planar vorbis
eac3 pcm_s32be vp8_v4l2m2m
ffv1 pcm_s32le vp8_vaapi
ffvhuff pcm_s32le_planar wavpack
fits pcm_s64be webvtt
flac pcm_s64le wmav1
flashsv pcm_s8 wmav2
flashsv2 pcm_s8_planar wmv1
flv pcm_u16be wmv2
g723_1 pcm_u16le wrapped_avframe
gif pcm_u24be xbm
h261 pcm_u24le xface
h263 pcm_u32be xsub
h263_v4l2m2m pcm_u32le xwd
h263p pcm_u8 y41p
h264_v4l2m2m pcx yuv4
h264_vaapi pgm zlib
hevc_vaapi pgmyuv zmbv
huffyuv png
Enabled hwaccels:
h263_vaapi mpeg1_vdpau vc1_vdpau
h264_vaapi mpeg2_vaapi vp8_vaapi
h264_vdpau mpeg2_vdpau vp9_vaapi
hevc_vaapi mpeg4_vaapi wmv3_vaapi
hevc_vdpau mpeg4_vdpau wmv3_vdpau
mjpeg_vaapi vc1_vaapi
Enabled parsers:
aac dvdsub png
aac_latm flac pnm
ac3 g729 rv30
adx gsm rv40
bmp h261 sbc
cavsvideo h263 sipr
cook h264 tak
dca hevc vc1
dirac mjpeg vorbis
dnxhd mlp vp3
dpx mpeg4video vp8
dvaudio mpegaudio vp9
dvbsub mpegvideo xma
dvd_nav opus
Enabled demuxers:
aa eac3 jacosub
aac epaf jv
ac3 ffmetadata live_flv
acm filmstrip lmlm4
act fits loas
adf flac lrc
adp flic lvf
ads flv lxf
adx fourxm m4v
aea frm matroska
afc fsb mgsts
aiff g722 microdvd
aix g723_1 mjpeg
amr g726 mjpeg_2000
amrnb g726le mlp
amrwb g729 mlv
anm gdv mm
apc genh mmf
ape gif mov
apng gsm mp3
aptx gxf mpc
aptx_hd h261 mpc8
aqtitle h263 mpegps
asf h264 mpegts
asf_o hevc mpegtsraw
ass hls mpegvideo
ast hnm mpjpeg
au ico mpl2
avi idcin mpsub
avr idf msf
avs iff msnwc_tcp
bethsoftvid ilbc mtaf
bfi image2 mtv
bfstm image2_alias_pix musx
bink image2_brender_pix mv
bintext image2pipe mvi
bit image_bmp_pipe mxf
bmv image_dds_pipe mxg
boa image_dpx_pipe nc
brstm image_exr_pipe nistsphere
c93 image_j2k_pipe nsp
caf image_jpeg_pipe nsv
cavsvideo image_jpegls_pipe nut
cdg image_pam_pipe nuv
cdxl image_pbm_pipe ogg
cine image_pcx_pipe oma
codec2 image_pgm_pipe paf
codec2raw image_pgmyuv_pipe pcm_alaw
concat image_pictor_pipe pcm_f32be
data image_png_pipe pcm_f32le
daud image_ppm_pipe pcm_f64be
dcstr image_psd_pipe pcm_f64le
dfa image_qdraw_pipe pcm_mulaw
dirac image_sgi_pipe pcm_s16be
dnxhd image_sunrast_pipe pcm_s16le
dsf image_svg_pipe pcm_s24be
dsicin image_tiff_pipe pcm_s24le
dss image_webp_pipe pcm_s32be
dts image_xpm_pipe pcm_s32le
dtshd ingenient pcm_s8
dv ipmovie pcm_u16be
dvbsub ircam pcm_u16le
dvbtxt iss pcm_u24be
dxa iv8 pcm_u24le
ea ivf pcm_u32be
ea_cdata ivr pcm_u32le
pcm_u8 shorten v210x
pjs siff vag
pmp sln vc1
pva smacker vc1t
pvf smjpeg vivo
qcp smush vmd
r3d sol vobsub
rawvideo sox voc
realtext spdif vpk
redspark srt vplayer
rl2 stl vqf
rm str w64
roq subviewer wav
rpl subviewer1 wc3
rsd sup webm_dash_manifest
rso svag webvtt
rtp swf wsaud
rtsp tak wsd
s337m tedcaptions wsvqa
sami thp wtv
sap threedostr wv
sbc tiertexseq wve
sbg tmv xa
scc truehd xbin
sdp tta xmv
sdr2 tty xvag
sds txd xwma
sdx ty yop
segafilm v210 yuv4mpegpipe
Enabled muxers:
a64 hls pcm_s24le
ac3 ico pcm_s32be
adts ilbc pcm_s32le
adx image2 pcm_s8
aiff image2pipe pcm_u16be
amr ipod pcm_u16le
apng ircam pcm_u24be
aptx ismv pcm_u24le
aptx_hd ivf pcm_u32be
asf jacosub pcm_u32le
asf_stream latm pcm_u8
ass lrc psp
ast m4v rawvideo
au matroska rm
avi matroska_audio roq
avm2 md5 rso
bit microdvd rtp
caf mjpeg rtp_mpegts
cavsvideo mkvtimestamp_v2 rtsp
codec2 mlp sap
codec2raw mmf sbc
crc mov scc
dash mp2 segafilm
data mp3 segment
daud mp4 singlejpeg
dirac mpeg1system smjpeg
dnxhd mpeg1vcd smoothstreaming
dts mpeg1video sox
dv mpeg2dvd spdif
eac3 mpeg2svcd spx
f4v mpeg2video srt
ffmetadata mpeg2vob stream_segment
fifo mpegts sup
fifo_test mpjpeg swf
filmstrip mxf tee
fits mxf_d10 tg2
flac mxf_opatom tgp
flv null truehd
framecrc nut tta
framehash oga uncodedframecrc
framemd5 ogg vc1
g722 ogv vc1t
g723_1 oma voc
g726 opus w64
g726le pcm_alaw wav
gif pcm_f32be webm
gsm pcm_f32le webm_chunk
gxf pcm_f64be webm_dash_manifest
h261 pcm_f64le webp
h263 pcm_mulaw webvtt
h264 pcm_s16be wtv
hash pcm_s16le wv
hds pcm_s24be yuv4mpegpipe
hevc
Enabled protocols:
async http rtmpt
cache httpproxy rtp
concat icecast srtp
crypto md5 subfile
data mmsh tcp
ffrtmphttp mmst tee
file pipe udp
ftp prompeg udplite
gopher rtmp unix
hls
Enabled filters:
abench bench fifo
abitscope biquad fillborders
acompressor bitplanenoise firequalizer
acontrast blackdetect flanger
acopy blend floodfill
acrossfade bwdif format
acrusher cellauto fps
adelay channelmap framepack
adrawgraph channelsplit framerate
aecho chorus framestep
aemphasis chromakey gblur
aeval ciescope gradfun
aevalsrc codecview haas
afade color haldclut
afftfilt colorbalance haldclutsrc
afifo colorchannelmixer hdcd
afir colorkey headphone
aformat colorlevels hflip
agate colorspace highpass
ahistogram compand hilbert
aiir compensationdelay histogram
ainterleave concat hqx
alimiter convolution hstack
allpass convolve hue
allrgb copy hwdownload
allyuv crop hwmap
aloop crossfeed hwupload
alphaextract crystalizer hysteresis
alphamerge curves idet
amerge datascope il
ametadata dcshift inflate
amix dctdnoiz interleave
amovie deband join
anequalizer decimate lenscorrection
anoisesrc deconvolve life
anull deflate limiter
anullsink deflicker loop
anullsrc deinterlace_vaapi loudnorm
apad dejudder lowpass
aperms denoise_vaapi lumakey
aphasemeter deshake lut
aphaser despill lut2
apulsator detelecine lut3d
arealtime dilation lutrgb
aresample displace lutyuv
areverse doubleweave mandelbrot
aselect drawbox maskedclamp
asendcmd drawgraph maskedmerge
asetnsamples drawgrid mcompand
asetpts drmeter mergeplanes
asetrate dynaudnorm mestimate
asettb earwax metadata
ashowinfo ebur128 midequalizer
asidedata edgedetect minterpolate
asplit elbg mix
astats entropy movie
astreamselect equalizer negate
atadenoise erosion nlmeans
atempo extractplanes noformat
atrim extrastereo noise
avectorscope fade normalize
avgblur fftfilt null
bandpass field nullsink
bandreject fieldhint nullsrc
bass fieldmatch oscilloscope
bbox fieldorder overlay
pad setpts swaprect
palettegen setrange swapuv
paletteuse setsar tblend
pan settb telecine
perms sharpness_vaapi testsrc
pixdesctest showcqt testsrc2
pixscope showfreqs threshold
premultiply showinfo thumbnail
prewitt showpalette tile
procamp_vaapi showspectrum tlut2
pseudocolor showspectrumpic tonemap
psnr showvolume transpose
qp showwaves treble
random showwavespic tremolo
readeia608 shuffleframes trim
readvitc shuffleplanes unpremultiply
realtime sidechaincompress unsharp
remap sidechaingate vectorscope
removegrain sidedata vflip
removelogo signalstats vfrdet
replaygain silencedetect vibrato
reverse silenceremove vignette
rgbtestsrc sine vmafmotion
roberts smptebars volume
rotate smptehdbars volumedetect
scale sobel vstack
scale2ref spectrumsynth w3fdif
scale_vaapi split waveform
select ssim weave
selectivecolor stereotools xbr
sendcmd stereowiden yadif
separatefields streamselect yuvtestsrc
setdar superequalizer zoompan
setfield surround
Enabled bsfs:
aac_adtstoasc hapqa_extract mpeg4_unpack_bframes
chomp hevc_metadata noise
dca_core hevc_mp4toannexb null
dump_extradata imx_dump_header remove_extradata
eac3_core mjpeg2jpeg text2movsub
extract_extradata mjpega_dump_header trace_headers
filter_units mov2textsub vp9_raw_reorder
h264_metadata mp3_header_decompress vp9_superframe
h264_mp4toannexb mpeg2_metadata vp9_superframe_split
h264_redundant_pps
Enabled indevs:
alsa oss v4l2
fbdev sndio xcbgrab
lavfi
Enabled outdevs:
alsa sdl2 v4l2
fbdev sndio xv
oss
License: LGPL version 2.1 or later
config.asm is unchanged
libavutil/avconfig.h is unchanged
libavfilter/filter_list.c is unchanged
libavcodec/codec_list.c is unchanged
libavcodec/parser_list.c is unchanged
libavcodec/bsf_list.c is unchanged
libavformat/demuxer_list.c is unchanged
libavformat/muxer_list.c is unchanged
libavdevice/indev_list.c is unchanged
libavdevice/outdev_list.c is unchanged
libavformat/protocol_list.c is unchanged
ffbuild/config.sh is unchanged
```