c++ - Including ffmpeg in qt project on windows causes the program to unexpectedly finish -


i trying include ffmpeg in qt project on windows. running qt4 , compiling microsoft visual compiler 2010 on 32 bit windows 7. trying include ffmpeg 2.8 got dev , shared downloads zeranoe. when run following output:

starting (executable path)... program has unexpectedly finished. (executable path) exited code -1073741819

i able produce output following:

ffmpeg_test.pro:

qt += core target = ffmpeg_test  includepath += (ffmpeg dev path)/include libs += -l(ffmpeg dev path)/lib libs += -lavformat  sources += main.cpp 

main.cpp:

extern "c" { #ifndef __stdc_constant_macros #define __stdc_constant_macros #endif #include <libavformat/avformat.h> }  int main(int argc, char *argv[]) {   av_register_all();   return 0; } 

i have put .dll files ffmpeg share bin same folder qt builds ffmpeg_test.exe into. have confirmed found using dependency walker shows question mark when not in directory , avformat-56.dll file path when (the fact .dll files found not effect output of program).

dependency walker reveal weird going on there no expected functions, functions found in avformat-56.dll correct. have ran dumpbin.exe /exports on avformat.lib , looks fine (i can post output if helpful). worth noting have included version of ffmpeg in different application on machine, not qt project however. project generated make file cmake rather qmake , built microsoft visual c++ 2010 rather qt creator.

i have included other .lib/.dll pairs in qt , have no problems. noticing 2 differences pairs. first in ffmpeg-dev lib folder instead of having .lib files (as case other .lib/.dll pairs) have .def , .dll.a file each library. second ffmpeg c library whereas other included libraries c++.

update 3/29:

i have tried replacing libs lines in .pro both of following:

libs += (ffmpeg dev path)/lib/avformat.lib

libs += (ffmpeg dev path)/lib/libavformat.dll.a

both give same error message. have tried adding following .pro file no effect.

defines += __stdc_constant_macros qmake_cxx_flags += -d_stdc_constant_macros

additionally tried adding #define inline __inline main.cpp suggested on ffmpeg website. ideas of things try hugely appreciated!

update 3/31:

i have tried start on new windows build environment result remains unchanged test code above. (the new environment able run hello world program).

my process setting environment install fresh version of 32 bit windows 7. install visual c++ 2010 express visual studio 2010 express all-in-one iso. install qt 4.8.6 32 bit windows , visual studio 2010. , install qt creator 2.5.2. set qt creator went under tools->options , told find qt 4.8.6 qmake. downloaded dev , shared builds ffmpeg 2.8 zeranoe. missing stdint.h , inttypes downloaded them , put files in /include/libavutil. corrected of header files complained "stdint.h" ect. put dll files ffmpeg-2.8-win32-shared/bin folder qt building ffmpeg_test ffmpeg_test-build-desktop-qt_4_8_6__4_8_6__release/release.

the problem ffmpeg compiled mingw compiler , libraries compiled different compilers may not compatible. able make test program run correctly getting mingw compiler , setting qt mingw. version of ffmpeg did not require changes involving stdint.h or inttypes.h. how version of ffmpeg able compile using msvc , cmake still mystery me. path forward question if switching mingw compiler option or if need compile ffmpeg msvc.


Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -