[vlc-devel] Failures cross-compiling vcd/cdrom.c and dshow/filter.cpp (mingw32 from Gentoo)

Charles Duffy cduffy at spamcop.net
Sun Nov 26 22:50:08 CET 2006


I'm cross-compiling from Gentoo (environment created by "sudo crossdev 
-t mingw32", including gcc 4.1.1), with the provided contrib binaries 
and some symlinks creation to mirror the Debian /usr/win32 path structure.

In both 0.8.5 release and current svn (r18089), there are multiple 
failures. The first of these follows:

=== SNIP
if mingw32-gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I. -I../.. 
-I/usr/win32/include -I/usr/win32/include/ebml -D_OFF_T_ -D_off_t=long 
-DSYS_MINGW32 -I../../include `top_builddir="../.." ../../vlc-config 
--cflags plugin cdda` -mms-bitfields -Wall -Wextra -Wno-unused-parameter 
-Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wcast-align 
-Wwrite-strings -Wold-style-definition -Wmissing-prototypes 
-Wvolatile-register-var -MT libcdda_plugin_a-cdrom.o -MD -MP -MF 
".deps/libcdda_plugin_a-cdrom.Tpo" -c -o libcdda_plugin_a-cdrom.o `test 
-f 'vcd/cdrom.c' || echo './'`vcd/cdrom.c; \
         then mv -f ".deps/libcdda_plugin_a-cdrom.Tpo" 
".deps/libcdda_plugin_a-cdrom.Po"; else rm -f 
".deps/libcdda_plugin_a-cdrom.Tpo"; exit 1; fi
vcd/cdrom.c: In function 'win32_vcd_open':
vcd/cdrom.c:1164: error: invalid lvalue in assignment
vcd/cdrom.c:1166: error: invalid lvalue in assignment
make[4]: *** [libcdda_plugin_a-cdrom.o] Error 1
=== SNIP

In this particular case, there's a cast against the *target*, rather 
than the source, of an assignment.

=== SNIP
(FARPROC) lpGetSupport = GetProcAddress(hASPI, "GetASPI32SupportInfo" );
(FARPROC) lpSendCommand = GetProcAddress(hASPI, "SendASPI32Command" );
=== SNIP

...and moving the cast to the source makes this a warning rather than an 
error; well enough.



The next error is not so trivial to work around:

=== SNIP
if mingw32-g++ -DHAVE_CONFIG_H -I. -I. -I../../..   -I/usr/win32/include 
-I/usr/win32/include/ebml -D_OFF_T_ -D_off_t=long -DSYS_MINGW32 
-I../../../include `top_builddir="../../.." ../../../vlc-config 
--cxxflags plugin dshow` -mms-bitfields  -Wall -Wextra 
-Wno-unused-parameter -Wsign-compare -Wundef -Wpointer-arith 
-Wbad-function-cast -Wcast-align -Wwrite-strings -Wold-style-definition 
-Wmissing-prototypes -Wvolatile-register-var -pipe -MT 
libdshow_plugin_a-filter.o -MD -MP -MF 
".deps/libdshow_plugin_a-filter.Tpo" -c -o libdshow_plugin_a-filter.o 
`test -f 'filter.cpp' || echo './'`filter.cpp; \
         then mv -f ".deps/libdshow_plugin_a-filter.Tpo" 
".deps/libdshow_plugin_a-filter.Po"; else rm -f 
".deps/libdshow_plugin_a-filter.Tpo"; exit 1; fi
cc1plus: warning: command line option "-Wbad-function-cast" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wold-style-definition" is valid 
for C/ObjC but not for C++
cc1plus: warning: command line option "-Wmissing-prototypes" is valid 
for C/ObjC but not for C++
In file included from filter.cpp:39:
common.h:37:1: warning: "_WINGDI_" redefined
In file included from /usr/mingw32/mingw/include/windows.h:52,
                  from ../../../include/vlc_common.h:492,
                  from ../../../include/vlc/vlc.h:152,
                  from filter.cpp:31:
/usr/mingw32/mingw/include/wingdi.h:3:1: warning: this is the location 
of the previous definition
filter.cpp: In member function 'virtual long int 
CapturePin::QueryId(WCHAR**)':
filter.cpp:586: warning: deprecated conversion from string constant to 
'WCHAR*''
filter.cpp: At global scope:
filter.cpp:1284: error: 'long int 
IMemAllocator*::*LTHUNK1(IMemAllocator**)' aliased to undefined symbol 
'_ZN10CapturePin12GetAllocatorEPP13IMemAllocator'
filter.cpp:1284: error: 'long int 
IMemAllocator::*LTHUNK2(IMemAllocator*, BOOL)' aliased to undefined 
symbol '_ZN10CapturePin15NotifyAllocatorEP13IMemAllocatori'
filter.cpp:1284: error: 'long int 
ALLOCATOR_PROPERTIES::*LTHUNK3(ALLOCATOR_PROPERTIES*)' aliased to 
undefined symbol 
'_ZN10CapturePin24GetAllocatorRequirementsEP20_AllocatorProperties'
filter.cpp:1284: error: 'long int 
IMediaSample*::*LTHUNK4(IMediaSample**, long int, long int*)' aliased to 
undefined symbol '_ZN10CapturePin15ReceiveMultipleEPP12IMediaSamplelPl'
filter.cpp:1284: error: 'long int *LTHUNK5()' aliased to undefined 
symbol '_ZN10CapturePin15ReceiveCanBlockEv'
filter.cpp:1284: error: 'ULONG *LTHUNK6()' aliased to undefined symbol 
'_ZN10CapturePin7ReleaseEv'
filter.cpp:1284: error: 'long int const IID::*LTHUNK7(const IID&, 
void**)' aliased to undefined symbol 
'_ZN10CapturePin14QueryInterfaceERK5_GUIDPPv'
filter.cpp:1284: error: 'long int IMediaSample::*LTHUNK8(IMediaSample*)' 
aliased to undefined symbol '_ZN10CapturePin7ReceiveEP12IMediaSample'
make[6]: *** [libdshow_plugin_a-filter.o] Error 1
=== SNIP

First, it's a little curious that we're manually redefining _WINGDI_ 
whenever _MSC_VER isn't defined, even when the relevant header file has 
already been imported. More important, though, are the actual errors -- 
and since they're C++-centric, I (being more C-oriented) am not really 
equipped to make heads or tails of them.

More to the point, since cross compilation using mingw32 is apparently 
the official way to do win32 builds, there's obviously something in my 
environment that doesn't match what 'yall are using upstream. Could 
anyone be so kind as to offer a suggestion or two? Knowing which version 
of GCC is installed by the Debian cross-development packages would be 
helpful; reports of success or failure doing cross-compilation with 
Gentoo would be even more useful.

Thanks!

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



More information about the vlc-devel mailing list