UBUNTU16 64位 编译VLC3.0.4 WIN32版本,遇到的问题及解决方案

参考官网:

https://wiki.videolan.org/Win32Compile/   使用MAKE FETCH

1,编译过程中提示需要安装:gperf    flex   bison 

2,dxgi1_2.h错误:

i686-w64-mingw32-widl -DBOOL=WINBOOL -I/usr/include/wine/windows/ -h -o /home/d/vlc-3.0.0/contrib/i686-w64-mingw32/include/dxgi1_2.h dxgi12/dxgi1_2.idl
dxgi12/dxgi1_2.idl:43: error: syntax error, unexpected aKNOWNTYPE, expecting tIMPORT
../../contrib/src/d3d11/rules.mak:65: recipe for target '/home/d/vlc-3.0.0/contrib/i686-w64-mingw32/include/dxgi1_2.h' failed
make: *** [/home/d/vlc-3.0.0/contrib/i686-w64-mingw32/include/dxgi1_2.h] Error 1

https://forum.videolan.org/viewtopic.php?f=32&t=134115  解决:dxgi12/dxgi1_2.idl:43: error: syntax error, unexpected aKNOWNTYPE, expecting tIMPORT
解决方案:
apt-get install wine64-development-tools 
motify contib\src\d3d9\rules.mak and contrib\src\d3d11\rules.mak IDL_INC_PATH = /usr/include/wine/windows/ to IDL_INC_PATH = /usr/include/wine-development/windows/

可以使用GEDIT等编辑工具修改,也可如下:

nano ../src/d3d9/rules.mak [manually change IDL_INC_PATH from wine to wine-development]
nano ../src/d3d11/rules.mak [manually change IDL_INC_PATH from wine to wine-development]

3,versioninfo.rc错误:

i686-w64-mingw32-windres: versioninfo.rc.in:21: syntax error 
i686-w64-mingw32-windres: preprocessing failed. 
Makefile:1224: recipe for target 'versioninfo.lo' failed 
make[2]: *** [versioninfo.lo] Error 1 
make[2]: Leaving directory '/home/d/vlc-3.0.0/contrib/win32/gcrypt/src' 
Makefile:487: recipe for target 'install-recursive' failed 
make[1]: *** [install-recursive] Error 1 
make[1]: Leaving directory '/home/d/vlc-3.0.0/contrib/win32/gcrypt' 
../../contrib/src/gcrypt/rules.mak:72: recipe for target '.gcrypt' failed 
make: *** [.gcrypt] Error 2 

解决方案:

https://forum.videolan.org/viewtopic.php?f=32&t=143536&p=478964&hilit=versioninfo.rc#p478964
https://bugs.debian.org/cgi-bin/bugrepo ... bug=814954

you need to modify the configure.ac (Row 42) file inside contrib/win32/gcrypt/configure.ac  

- m4_esyscmd([git rev-parse --short HEAD | tr -d '\n\r']))
+ m4_esyscmd([printf %x $(wc -l < debian/changelog)]))

 

4,proto错误:

缺PROTOCBUF 或版本不匹配的问题:
../../contrib/src/protobuf/rules.mak:24: *** Protobuf compiler (protoc) not found!.  Stop.
$ sudo apt-get install  libprotobuf-dev protobuf-compiler
$ protoc --version
libprotoc 2.6.1

google/protobuf/any_test.proto:31:10: Unrecognized syntax identifier "proto3".  This parser only recognizes "proto2".
Makefile:7304: recipe for target 'unittest_proto_middleman' failed
make[3]: *** [unittest_proto_middleman] Error 1

(VLC3.0.X需要版本须大于UBUNTU提供的2.6.1,我安装了3.6.1)

将PROTOCBUF升级到3.6.1版本,此问题消失,升级办法:apt-get update apt-get upgrade apt-get build-dep vlc 
如果还不行,就下载最新版本手动安装。
https://github.com/protocolbuffers/protobuf/releases/  最新版本位置
https://blog.csdn.net/blue_it/article/details/53996216  ubuntu下protobuf安装  相关问题里面有明确表述

09月30号更新:应该是与PROTOBUF 版本有关,我看了下MIGW-W64中的下载下来的版本是3.1.0,而我使用了最新的3.6.1,造成了这些头文件错误与下面的错误8 如果安装3.1.0问题就都没有了。安装3.1.0时注意将3.6.1卸干净,或用干净的虚拟机。(不知为什么我的CSDN回复不了,半空飞雪水: 这位朋友看这儿吧。)

5,mta_holder.h    错误

缺文件问题及解决出处
dshow.cpp:55:37: fatal error: ../src/win32/mta_holder.h: No such file or directory

https://forum.videolan.org/viewtopic.php?f=14&t=144321&p=472846&hilit=dshow.cpp%3A55%3A37%3A+fatal#p472846
https://raw.githubusercontent.com/videolan/vlc/master/src/win32/mta_holder.h

6,MINGW-W64错误:缺如下:wrl文件夹,roapi.h dwrite.h  dwrite_1.h  dwrite_2.h   versionhelpers.h

以下文件在MINGW-W64中取。
fatal error: wrl/client.h: No such file or directory
https://forum.videolan.org/viewtopic.php?f=32&t=137580&p=453684&hilit=roapi.h%3A80%3A25#p453684
将\mingw-w64-mingw-w64-2c51561eda7874ad79add69b9efdb0d6ba83c17c\mingw-w64-headers\include\wrl 文件夹放在编译包的contrib/i686-w64-mingw32/include

https://sourceforge.net/p/mingw-w64/mingw-w64/ci/v5.x/tree/mingw-w64-headers/include/wrl/wrappers/


/usr/share/mingw-w64/include/roapi.h: In function ‘void ABI::Windows::Foundation::Uninitialize()’:
/usr/share/mingw-w64/include/roapi.h:80:25: error: ‘RoUninitialize’ was not declared in this scope
解决办法:
https://forum.videolan.org/viewtopic.php?f=32&t=137580&p=453684&hilit=roapi.h%3A80%3A25#p453684
mingw-w64-headers/include/roapi.h" and copy to contrib/i686-w64-mingw32/include/

https://forum.videolan.org/viewtopic.php?f=32&t=137580&p=453684&hilit=roapi.h%3A80%3A25#p453684

dwrite.h 
dwrite_1.h 
dwrite_2.h
新问题1:

versionhelpers.h   此文件拷贝成功后,    

9月30号更新:如果版本太新,70行也有一个_WIN32_WINNT_WINBLUE 报错不能识别,我改成了_WIN32_WINNT_WIN8

如果取最新版本的这个头文件,可能有其它报错未定义的,应该是版本未识别,我都按WIN8处理了。

7,PROTOBUF的错误:

from ../../modules/stream_out/chromecast/cast.cpp:33:
stream_out/chromecast/cast_channel.pb.h:10:40: fatal error: i686_w64-mingw32/include/google/protobuf/port_def.inc: No such file or directory

port_def.inc
port_undef.inc
generated_message_table_driven.h 
inlined_string_field.h
port.h  
metadata_lite.h
这些文件需要在PROTOBU文件中取。

09月30号更新:应该是与PROTOBUF 版本有关,我看了下MIGW-W64中的下载下来的版本是3.1.0,而我使用了最新的3.6.1,造成了这些头文件错误与下面的错误8 如果安装3.1.0问题就都没有了。

8,最后MAKE时  

09月30号更新:此问题已在7解决,安装PROTOBUF3.1.0 版本,或与MAKE  FETCH 下来的版本一致应该没这个问题了。

新问题1
stream_out/chromecast/cast_channel.pb.h:1324:35: error: ‘struct google::protobuf::internal::ArenaStringPtr’ has no member named ‘ReleaseNonDefaultNoArena’

/home/d/vlc-3.0.3/contrib/win32/ebml/src/EbmlSInteger.cpp:147:45: error: ‘numeric_limits’ is not a member of ‘std’
     uint64_t TempValue = Buffer[0] & 0x80 ? std::numeric_limits::max(
                                             ^
/home/d/vlc-3.0.3/contrib/win32/ebml/src/EbmlSInteger.cpp:147:73: error: expected primary-expression before ‘>’ token
 uint64_t TempValue = Buffer[0] & 0x80 ? std::numeric_limits::max() : 
                                                                     ^
/home/d/vlc-3.0.3/contrib/win32/ebml/src/EbmlSInteger.cpp:147:74: error: ‘::max’ has not been declared
CMakeFiles/ebml.dir/build.make:313: recipe for target 'CMakeFiles/ebml.dir/src/EbmlSInteger.cpp.obj' failed
make[3]: *** [CMakeFiles/ebml.dir/src/EbmlSInteger.cpp.obj] Error 1

不得以采用了配置:../configure --host=i686-w64-mingw32 --disable-chromecast     如有解决这个问题的请告知我。多谢。

如果有QT错误需要:--disable-qt  有这个VLC可执行程序打不开,但库文件可正常使用。

至此重新MAKE成功:  经测试库文件可用。

9,打包失败:  如有解决这个问题的请告知我。多谢。

打包失败
cp: cannot stat '../share/hrtfs': No such file or directory
Makefile:2388: recipe for target 'package-win-common' failed

我手动建了这个vlc-3.0.4/share/hrtfs(空文件),打包成功,不知有没有其它解决方案。

10,如果编译过程中有其它问题请看我的:https://mp.csdn.net/postedit/82782293  说不定解决过了。

另我9月30号也按网上的说法将gettext版本升级到了最新版本,如果您的现象和我的不一样,不防也更新下这个。

 

另,打包好的VLC.EXE不能运行,即使只DISABLE CHROMECAST也不行,

UBUNTU下报错为无LIBSSP-0.DLL,

 

我从网上DOWN了此库,运行报错如下:有高手请帮看下,不胜感激。

9月30号将新打包好的程序加入此库文件运行正常。!!!终于Everything is Ok  以下错误保留。

Unhandled exception: unimplemented function KERNEL32.dll.InitializeConditionVariable called in 32-bit code (0x7bc4cf69).
Register dump:
 CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b
 EIP:7bc4cf69 ESP:0064f758 EBP:0064f7cc EFLAGS:00200212(   - --  I   -A- - )
 EAX:6e34d4ba EBX:7bcbe000 ECX:001551d0 EDX:6a7f545c
 ESI:0064f770 EDI:001551b8
Stack dump:
0x0064f758:  0064f780 7b8ae000 7bc4cf43 001551b8
0x0064f768:  0064f798 7b86c67f 80000100 00000001
0x0064f778:  00000000 7bc4cf69 00000002 6e34d828
0x0064f788:  6e34d4ba 6a7f545c 0064f7b0 7b8ae000
0x0064f798:  0064f7c8 7b86c6d8 0015559c 001555a0
0x0064f7a8:  00000000 7b86c6d8 001551b8 00000000
Backtrace:
=>0 0x7bc4cf69 call_dll_entry_point+0x449() in ntdll (0x0064f7cc)
  1 0x0024000f (0x001551d4)
0x7bc4cf69 call_dll_entry_point+0x449 in ntdll: addl    $12,%esp
Modules:
Module    Address            Debug info    Name (462 modules)
PE      3d0000-  3f2000    Deferred        libstream_out_cycle_plugin


 

10,UBUNTU18下不能编译成功,有如下报错:   如有解决这个问题的请告知我。多谢。

i686-w64-mingw32-ld: cannot find -lglu32
i686-w64-mingw32-ld: cannot find -lopengl32
i686-w64-mingw32-ld: cannot find -lgdi32
i686-w64-mingw32-ld: cannot find -luser32
i686-w64-mingw32-ld: cannot find -lkernel32
Makefile:101: recipe for target 'lib/glew32.dll' failed
make[1]: *** [lib/glew32.dll] Error 1
make[1]: Leaving directory '/home/d/vlc-3.0.4/contrib/win32/glew'
../../contrib/src/glew/rules.mak:22: recipe for target '.glew' failed
make: *** [.glew] Error 2

 

 

你可能感兴趣的:(vlc)