ffmpeg crashes on cygwin on launch with exit code

2019-06-05 12:51发布

问题:

I am trying to build ffmpeg with libx264 support. Configure and compilation is successful but when I am running the ffmpeg the application is crashing.

ffmpeg configure option : ./configure --enable-static --enable-libx264 --enable-pthreads --enable-gpl --disable-doc --enable-memalign-hack --extra-ldflags="-L/usr/local/lib"
gcc --version 4.3.4

Here is gdb dump,

$gdb ffmpeg_g.exe  
GNU gdb(GDB) 7.2  
Copyright(c) 2010 Free Software Foundation  
This GDB has configured as mingw32

Reading symbols from C:\work\ffmpeg25jan2011\ffmpeg\ffmpeg_g.exe.....done  
(gdb) break main  
BreakPoint 1 at 0x40a120 : file ffmpeg.c, line 4317  
(gdb) run -V  
Starting program: C:\work\ffmpeg25jan2011\ffmpeg\ffmpeg_g.exe  
[New Thread]  
gdb: Unknown Target exception 0xc0000022 at 0x7c96671e   
**During startup program exited with code 0xc0000022**  

Anybody has any clue, How this can be resolved?

回答1:

Windows error code 0xc0000022 means "The Application Failed to initialize." It usually indicates that your build is broken. There are lots of things that could have gone wrong, but here are some things to check:

  • You should build all libraries you link to with the same toolchain. It may be possible to link a Cygwin-built ffmpeg to a VC++-built libx264, but since there's no good reason to do that, you shouldn't.

  • Try the "head" version of ffmpeg and its dependencies from the source repository

  • You show Windows paths, but claim to be using Cygwin. Try to use an all-Cygwin environment: build from a Cygwin bash shell, use POSIX paths, etc. In particular, this will help ensure that libraries get installed in places the build tools can find them.

  • You may need to install some libraries in /usr/lib, rather than the default, /usr/local/lib.

  • Try a complete rebuild: make clean && make