Trouble compiling wxWindows plugin in Visual C++ 7.1

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
Vlad
New Cone
New Cone
Posts: 2
Joined: 16 Jan 2004 15:34

Trouble compiling wxWindows plugin in Visual C++ 7.1

Postby Vlad » 16 Jan 2004 15:55

I try to build the wxWindows plugin in VC 7.1. I was successful in building wxWindows 2.4.2 library and all its samples and demos. However, when I try to build the VLC wxWindow plugin, I got such error:

"error C2628: '_off_t' followed by '__int64' is illegal (did you forget a ';'?)"

it points to the typedef line in wxWindow file filefn.h

#if defined(__VISUALC__) || ( defined(__MWERKS__) && defined( __INTEL__) )
typedef _off_t off_t;

This file didn't give me any trouble when I compiled wxWindow library and samples. Therefore, the trouble is related somehow to the VLC usage of the headers and defines. The VLC developer documentation (BTW, seems not updated since 2001) tells something about off_t data type and necessity to compile with -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98.
In VC++, the off_t is already defined as 64 bit, so the compiler option doesn't seem to be needed.
I am puzzled why compiling the library itself didn't give me any trouble.

Please help to resolve the situation.

The DJ
Cone Master
Cone Master
Posts: 5987
Joined: 22 Nov 2003 21:52
VLC version: git
Operating System: Mac OS X
Location: Enschede, Holland
Contact:

Postby The DJ » 16 Jan 2004 19:04

Why use VC++?
Don't use PMs for support questions.

Guest

Postby Guest » 16 Jan 2004 19:49

VC++ has very convenient debugger. I want to add one more input plugin, but, unfortunately, I can't use release version of wxWindows plugin with other modules built in debug mode - it keeps generating exceptions.

I found the source of the conflict: wxWindow file filefn.h has typedef for off_t:

#if defined(__VISUALC__) || ( defined(__MWERKS__) && defined( __INTEL__) )
typedef _off_t off_t;

but earlier in vlc_common the same off_t already defined:

# if defined( _MSC_VER )
# if !defined( _OFF_T_DEFINED )
typedef __int64 off_t;
# define _OFF_T_DEFINED
# else
# define off_t __int64
# endif
# endif

so "typedef _off_t off_t" conflicts with earlier "define off_t __int64"

I think this is a bug. I found how to fix it by modifying code in filefn.h, but this is not the right way to do it - the wxWindow library shouldn't be modified for use in VLC.

I would appreciate any help in specifying what to modify in VLC code to make wxWindows buildable in Visual C++.

Sigmund
Big Cone-huna
Big Cone-huna
Posts: 893
Joined: 26 Nov 2003 09:38

Postby Sigmund » 16 Jan 2004 20:57

Try including the wxwindows headers before the vlc headers in the files in question

Gibalou
Big Cone-huna
Big Cone-huna
Posts: 608
Joined: 26 Nov 2003 10:59

Postby Gibalou » 17 Jan 2004 12:08

Btw Vlad, if you manage to get this compiled under VC, we would gladly accept patches.

Vlad
New Cone
New Cone
Posts: 2
Joined: 16 Jan 2004 15:34

building and running wxWindows plugin in VC++ 7.1

Postby Vlad » 19 Jan 2004 16:38

Btw Vlad, if you manage to get this compiled under VC, we would gladly accept patches.
I finally managed to build and run in debug mode the wxWindows plugin in Visual C++ 7.1 (.NET 2003). I had to make the following changes:

1) in wxWindows header file filefn.h (unfortunately):

added on line 34 the condition !defined( _OFF_T_DEFINED ), so the changed lines look like:

#if (!defined( _OFF_T_DEFINED ) && defined(__VISUALC__)) || ( defined(__MWERKS__) && defined( __INTEL__) )
typedef _off_t off_t;

2) two changes in wxWindows.cpp plugin file:

a) added #include <locale.h>
b) modified one line inside "static void Init( intf_thread_t *p_intf )" function (commented out hInstance and put GetModuleHandle call):
#if !defined(__BUILTIN__)
wxEntry( /*hInstance*/GetModuleHandle(NULL), NULL, NULL, SW_SHOW );

the hInstance was always NULL - at least when I ran it in Win XP, so I put there the explicit call to GetModuleHandle.


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 26 guests