[vlc-devel] Fwd: [PATCH] Patch for Windows (32 and 64 bit) compilation

fabrizio.ge at tiscali.it fabrizio.ge at tiscali.it
Tue Jan 13 23:15:29 CET 2015


  Hello,
here is an updated version of the patch.

Description of the
problem: I am compiling VLC from Git, from a Windows installation using
MSYS2 and the mingw-w64 toolchain targetting 32-bit, following the
instructions at https://wiki.videolan.org/Win32CompileMSYS/ .
During
build, this error
occurs:

source='../../extras/package/win32/../../../modules/services_discovery/upnp.cpp'
object='services_discovery/upnp.lo' libtool=yes 
DEPDIR=.deps
depmode=none /bin/sh
../../extras/package/win32/../../../autotools/depcomp 
../doltcompile
i686-w64-mingw32-g++ -DHAVE_CONFIG_H -I.
-I../../extras/package/win32/../../../modules -I..
-DMODULE_STRING="$(p="services_discovery/upnp.lo"; p="${p##*/}";
p="${p#lib}"; p="${p%_plugin*}"; p="${p%.lo}"; echo "$p")" -D__PLUGIN__
-I../../extras/package/win32/../../../modules/access
-I../../extras/package/win32/../../../modules/codec
-I../../extras/package/win32/../../../include -I../include
-I/c/Users/Fabrizio/Documents/vlc/contrib/i686-w64-mingw32/include
-D__USE_MINGW_ANSI_STDIO=1 -g -O2
-I/c/Users/Fabrizio/Documents/vlc/contrib/i686-w64-mingw32/include
-mms-bitfields -Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith
-Wvolatile-register-var -O3 -ffast-math -funroll-loops
-fomit-frame-pointer -c -o services_discovery/upnp.lo
../../extras/package/win32/../../../modules/services_discovery/upnp.cpp
In
file included from
../../extras/package/win32/../../../include/vlc_common.h:43:0,
 from
../../extras/package/win32/../../../modules/services_discovery/upnp.hpp:34,

from
../../extras/package/win32/../../../modules/services_discovery/upnp.cpp:35:
C:/Users/Fabrizio/Documents/msys32/mingw32/i686-w64-mingw32/include/stdlib.h:346:36:
error: conflicting declaration of C function 'int atoi(const char*)'

int __cdecl atoi(const char *_Str);
 ^
In file included from
../config.h:819:0,
 from
../../extras/package/win32/../../../modules/services_discovery/upnp.cpp:32:
../../extras/package/win32/../../../include/vlc_fixups.h:304:34:
note: previous declaration 'NET_IFINDEX atoi(PCSTR)'
 # define
if_nametoindex(name) atoi(name)
 ^
Makefile:11849: recipe for target
'services_discovery/upnp.lo' failed
make: ***
[services_discovery/upnp.lo] Error 1
make: Leaving directory
'/c/Users/Fabrizio/Documents/vlc/win32/modules'

The root cause is that
the configure test incorrectly thinks that if_nametoindex is not
defined, so it enables a replacement in vlc_fixups.h. Later, the header
file netioapi.h from the Windows headers is included, and that does
define if_nametoindex: this causes the error.

The patch fixes the test
for if_nametoindex for 32-bit Windows. It also cleans up the tests for
connect and inet_pton.

Regards,
Fabrizio

Il 06.01.2015 08:34
fabrizio.ge at tiscali.it ha scritto: 

> Hello.
> 
> I tried following the
instructions at https://wiki.videolan.org/Win32CompileMSYS/ to compile
VLC for Windows, and had to apply some modifications to succeed. The
modifications are in the attached patch.
> 
> By the way,
ftp://ftp.videolan.org/pub/videolan/contrib/i686-w64-mingw32/vlc-contrib-i686-w64-mingw32-latest.tar.bz2
is missing the Windows .exe files moc.exe, rcc.exe and uic.exe (the
wiki page suggests to run the command 
> 
> rm -rf
i686-w64-mingw32/bin/moc i686-w64-mingw32/bin/uic
i686-w64-mingw32/bin/rcc i686-w64-mingw32/bin/luac
> 
> : this is right
because those are Linux ELF executables, not Windows executables.
However, while luac.exe for Windows is there, Windows versions of the
other files are not). I had to compensate for the lack by taking those
files from a Qt installation.
> 
> Regards,
> Fabrizio 
> 
> Connetti
gratis il mondo con la nuova indoona: hai la chat, le chiamate, le video
chiamate e persino le chiamate di gruppo.
> E chiami gratis anche i
numeri fissi e mobili nel mondo!
> Scarica subito l'app Vai su
https://www.indoona.com/ [1]
  


Connetti gratis il mondo con la nuova indoona:  hai la chat, le chiamate, le video chiamate e persino le chiamate di gruppo.
E chiami gratis anche i numeri fissi e mobili nel mondo!
Scarica subito l’app Vai su https://www.indoona.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20150113/89978cba/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: win32.patch
Type: text/x-diff
Size: 3486 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20150113/89978cba/attachment.patch>


More information about the vlc-devel mailing list