qt调用vlc
下载vlc-3.0.17-win32
1、vc头文件和库目录加上, 引入库(附件依赖项) libvlc.lib libvlccore.lib
2、
#ifdef _WIN32 #include <basetsd.h> typedef SSIZE_T ssize_t; #endif //qt要加 #include "vlc/vlc.h" libvlc_instance_t * inst; libvlc_media_player_t *mp; libvlc_media_t *m; inst = libvlc_new (0, NULL); m = libvlc_media_new_path (inst, "F:\\3s.mp4"); mp = libvlc_media_player_new_from_media (m); libvlc_media_player_set_hwnd (mp, (void*)label1->winId()); libvlc_media_release (m); libvlc_media_player_play (mp); libvlc_media_player_stop (mp); libvlc_media_player_release (mp); libvlc_release (inst);
3、https://blog.csdn.net/mrbone11/article/details/106060715
就是说你链接了一个使用较早版本编译器生成的.lib或者.obj文件,或者找不到“safe exception handlers”,才会报这个错误。
解决方法如下:项目->项目属性->链接器->命令行,在右侧其他选项中添加“/SAFESEH:NO”,这样就不会再报错了