VLC 2.0.2 compiling on Windows XP with MingGW/MSYS

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
SENCO
New Cone
New Cone
Posts: 6
Joined: 22 Apr 2008 14:04

VLC 2.0.2 compiling on Windows XP with MingGW/MSYS

Postby SENCO » 03 Jul 2012 17:13

I have experienced the following problem when compiling VLC on Windows XP since 2.0.2 update.

When compiling Qt4 module, it stops on dialogs_provider.cpp, as it has an include file (dialogs/preferences.hpp) with the following line:

Code: Select all

QRadioButton *small,*all;
(line 72: private members section).

The problem is that dialogs_provider.cpp includes main_interface.hpp which, in turn, includes <vlc_windows_interfaces.h> which now includes <objbase.h> (from TDM compiler) which through rpcndr.h defines small as a char. So the preprocessor changes the above line into:

Code: Select all

QRadioButton *char,*all;
Such thing is invalid, as char is a reserved word, so the compilation fails with the folloging unmeaningful info:
In file included from dialogs_provider.cpp:42:0:
dialogs/preferences.hpp: At global scope:
dialogs/preferences.hpp:72:19: error: expected unqualified-id before 'char'
dialogs/preferences.hpp:72:18: error: expected ';' at end of member declaration
dialogs/preferences.hpp:72:24: error: expected unqualified-id before ',' token
...some deprecation warnings...
make[1]: *** [libqt4_plugin_la-dialogs_provider.lo] Error 1
make[1]: Leaving directory `/vlc/modules/gui/qt4'
make: *** [all] Error 2
There is an evident workaround, that is to rename small variable into a different name. But I want to post here to help anyone which could find the same problem. If someone modifies the source to fix this bug, please, let me know to keep it in sync in the future.

Regards,

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: VLC 2.0.2 compiling on Windows XP with MingGW/MSYS

Postby Jean-Baptiste Kempf » 03 Jul 2012 22:23

This is a bug in your toolchain.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

SENCO
New Cone
New Cone
Posts: 6
Joined: 22 Apr 2008 14:04

Re: VLC 2.0.2 compiling on Windows XP with MingGW/MSYS

Postby SENCO » 04 Jul 2012 16:53

I have checked the origin of this file, and rpcndr.h comes with w32api package of MinGW and TDM. Both compilers uses the same file, which was last edited on 2006. On line 50 we can find:

Code: Select all

#define small char
This line is also present in latest cygwin. You can see here:
http://cygwin.com/cgi-bin/cvsweb.cgi/sr ... h_tag=HEAD

I know that using defines for that is troublesome and the correct way is using a typedef, but the fact is that all mingw/cygwin uses this.
This problem arose after the inclusion of "<objbase.h>" in vlc_windows_interfaces.h. Up to know, i'm using the following workaround:

Code: Select all

#include <objbase.h> #undef small
And now everything compiles fine.


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: Bing [Bot] and 32 guests