Hi.
I know this is unsupported but I am trying to use the Wine windows headers to port some Windows code to Mac OS X. I'm not really trying to use the Wine functionality - I use the headers more to define and map the existing Win32 defines, and datatypes to Mac OS so that I can make as few changes to the Windows code I am porting as possible.
My big question is: when I add the Wine headers to my project, it seems that every datatype in the wine headers is undefined. I noticed that most wine headers don't have any #includes in them.
is there some precompiled or metaheader that I should be including in all of the wine files in order to get the compiler to see the data types?
Thanks,
Mike
Mike wrote:
Hi.
I know this is unsupported but I am trying to use the Wine windows headers to port some Windows code to Mac OS X. I'm not really trying to use the Wine functionality - I use the headers more to define and map the existing Win32 defines, and datatypes to Mac OS so that I can make as few changes to the Windows code I am porting as possible.
My big question is: when I add the Wine headers to my project, it seems that every datatype in the wine headers is undefined. I noticed that most wine headers don't have any #includes in them.
is there some precompiled or metaheader that I should be including in all of the wine files in order to get the compiler to see the data types?
I'm not quite sure which data types you mean, but it sounds as though the only header file you want to include is windef.h.
Tried that.
But windef.h then requires tchar.h and wtypes.h. I include those and then the cascade starts. I end up having to add nearly every wine header in the windows directory.
Once I do that then I start getting all kinds of undefined types errors at compile time - mainly because the default wine/windows headers don't seem to include other #includes in them that define the types each file relies on. For example:
error: 'IID' does not name a type
in cguid.h:
extern const IID GUID_NULL;
There are *no* #includes in cguid.h so it appears IID is not being defined for that file unless some other header that defines it is pulled in first.
I hope there is one simple include file I can include to solve this problem and not have to spend a day going through the entire wine/windows file set and including everything.
Mike
Robert Shearman wrote:
Mike wrote:
Hi.
I know this is unsupported but I am trying to use the Wine windows headers to port some Windows code to Mac OS X. I'm not really trying to use the Wine functionality - I use the headers more to define and map the existing Win32 defines, and datatypes to Mac OS so that I can make as few changes to the Windows code I am porting as possible.
My big question is: when I add the Wine headers to my project, it seems that every datatype in the wine headers is undefined. I noticed that most wine headers don't have any #includes in them.
is there some precompiled or metaheader that I should be including in all of the wine files in order to get the compiler to see the data types?
I'm not quite sure which data types you mean, but it sounds as though the only header file you want to include is windef.h.
Mike wrote:
Tried that.
But windef.h then requires tchar.h and wtypes.h.
No, it doesn't. You need to give out more details of what you're trying to compile.
error: 'IID' does not name a type
windef.h doesn't mention IID. It's quite possible that this error is coming from your source file instead of windef.h. If that's the case then you'll need to include guiddef.h, but all of the COM header files, such as wtypes.h already do this.
On Tue, 16 Jan 2007, Mike wrote: [...]
My big question is: when I add the Wine headers to my project, it seems that every datatype in the wine headers is undefined. I noticed that most wine headers don't have any #includes in them.
Normally the Wine headers have the same set of #include directives as the PSDK headers. If that's not the case then it's a bug. But yes, the PSDK headers often don't include each other.
is there some precompiled or metaheader that I should be including in all of the wine files in order to get the compiler to see the data types?
You're probably thinking about 'windows.h'. This is the one header included by most Windows applications. However it includes most everything which may be causing problems too.
But since you're porting Windows code, how come it does not already include the right PSDK headers?
The correct answer to my problem is:
#include "guiddefs.h"
which I found only via much searching.
As for why the correct headers are not included, the answer to that is:
1. Typical, usual sloppy coding practices.
2. Lack of attention to detail and code organization.
3. The Windows developers probably used some kind of precompiled headers which makes up for the lack of the correct includes in the source files.
4. The source files do include the right headers, but the Windows headers don't work on Mac OS X and hence I have to substitute my own.
Mike
Francois Gouget wrote:
On Tue, 16 Jan 2007, Mike wrote: [...]
My big question is: when I add the Wine headers to my project, it seems that every datatype in the wine headers is undefined. I noticed that most wine headers don't have any #includes in them.
Normally the Wine headers have the same set of #include directives as the PSDK headers. If that's not the case then it's a bug. But yes, the PSDK headers often don't include each other.
is there some precompiled or metaheader that I should be including in all of the wine files in order to get the compiler to see the data types?
You're probably thinking about 'windows.h'. This is the one header included by most Windows applications. However it includes most everything which may be causing problems too.
But since you're porting Windows code, how come it does not already include the right PSDK headers?