Meson build error on Windows x64 Msvc 2017
Hello,
I am trying to compile gstreamer with meson on Windows with MSVC 2017 X64 architecture. I currently tried with gst-build branch 1.16 and also master. Same error occurred in both of them.
I have followed the instructions from https://github.com/GStreamer/gst-build
I have run these commands as you said Visual Studio command prompt of the appropriate architecture and version. meson build/ ninja -C build/
meson build/ does not give any errors. However, when I compile with ninja -C build/
It gives some of these errors: Errors:
subprojects\libnice\agent\candidate.h(159): error C2061: syntax error: identifier 'uint8_t'
Solution: I added #include <stdint.h> at the top of the header file of candidate.h and the error is gone. Compilation continued until the error #2
- I have got these REDEFINITION Errors at
[2179/3370] Linking static target subprojects/FFmpeg/libavcodec-static.a.
v210enc.o : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
[2212/3370] Linking target subprojects/FFmpeg/avcodec-58.dll.
Creating library subprojects\\FFmpeg\\avcodec.lib and object subprojects\\FFmpeg\\avcodec.exp
[2339/3370] Compiling C object subprojects/FFmpeg/00cc031@@avformat-static@sta/libavformat_hlsenc.c.obj.
FAILED: subprojects/FFmpeg/00cc031@@avformat-static@sta/libavformat_hlsenc.c.obj
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared\ws2def.h(103): warning C4005: 'AF_IPX': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um\winsock.h(456): note: see previous definition of 'AF_IPX'
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared\ws2def.h(235): error C2011: 'sockaddr': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um\winsock.h(481): note: see declaration of 'sockaddr'
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared\ws2def.h(437): error C2059: syntax error: 'constant'
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared\ws2def.h(633): error C2011: 'sockaddr_in': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um\winsock.h(308): note: see declaration of 'sockaddr_in'
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um\winsock2.h(136): error C2011: 'fd_set': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um\winsock.h(64): note: see declaration of 'fd_set'
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um\winsock2.h(180): error C2011: 'timeval': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um\winsock.h(107): note: see declaration of 'timeval'
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um\winsock2.h(236): error C2011: 'hostent': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um\winsock.h(163): note: see declaration of 'hostent'
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um\winsock2.h(249): error C2011: 'netent': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um\winsock.h(176): note: see declaration of 'netent'
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um\winsock2.h(256): error C2011: 'servent': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um\winsock.h(183): note: see declaration of 'servent'
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um\winsock2.h(268): error C2011: 'protoent': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um\winsock.h(195): note: see declaration of 'protoent'
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um\winsock2.h(364): error C2011: 'WSAData': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um\winsock.h(318): note: see declaration of 'WSAData'
I shouldn't modify winsock.h or ws2def.h. I think one of gstreamer library includes winsock.h after winsock2.h or maybe visa verse.
I think everyone who use Windows will get same errors. I haven't found any issue about it so I opened to inform you. Any help would be appreciated.
Thank you,