This is the
manual procedure (if you want do it yourself):
- Copy files from sdk to PellesC
- Get a copy of sal.h from VC or DDK or from here.
- Edit 'driverspecs.h' in a text editor, start the text replacement box then replace all
occourrences of "(##__drv_nop" with "(__drv_nop". Then save the file. - Now edit 'ShellApi.h', locate the line
// PATH = c:\windows\system32;C:\windows;c:\;C:\Program Files\Compilers\
Then add a space at the end of line and save the file.
10. Now edit 'stralign.h' and locate this code:
#if _STRALIGN_USE_SECURE_CRT
#define ua_wcscpy_s wcscpy_s
#endif
__inline
PUWSTR
static
_WINDOWS_INSECURE_DEPRECATE
ua_wcscpy(
__out_xcount("Sufficient length") PUWSTR Destination,
__in PCUWSTR Source
)
{
#pragma warning(push)
#pragma warning(disable:4995)
#pragma warning(disable:4996)
#ifdef _PREFAST_
#pragma warning(disable:__WARNING_BANNED_API_USAGE) // This function (ua_wcscpy) is also tagged as insecure and deprecated
#endif // _PREFAST_
return wcscpy(Destination, Source);
#pragma warning(pop)
}
Add inclusion of 'wchar.h' as below:
#if _STRALIGN_USE_SECURE_CRT
#define ua_wcscpy_s wcscpy_s
#endif
#include <wchar.h> //You have to add *only* this line
__inline
PUWSTR
static
_WINDOWS_INSECURE_DEPRECATE
ua_wcscpy(
__out_xcount("Sufficient length") PUWSTR Destination,
__in PCUWSTR Source
)
{
#pragma warning(push)
#pragma warning(disable:4995)
#pragma warning(disable:4996)
#ifdef _PREFAST_
#pragma warning(disable:__WARNING_BANNED_API_USAGE) // This function (ua_wcscpy) is also tagged as insecure and deprecated
#endif // _PREFAST_
return wcscpy(Destination, Source);
#pragma warning(pop)
}
Save the file.
11. Edit file 'Xenroll.h', replace the lines:
extern "C" IEnroll * WINAPI PIEnrollGetNoCOM(void);
extern "C" IEnroll2 * WINAPI PIEnroll2GetNoCOM(void);
extern "C" IEnroll4 * WINAPI PIEnroll4GetNoCOM(void);
with:
EXTERN_C IEnroll * WINAPI PIEnrollGetNoCOM(void);
EXTERN_C IEnroll2 * WINAPI PIEnroll2GetNoCOM(void);
EXTERN_C IEnroll4 * WINAPI PIEnroll4GetNoCOM(void);
12. PellesC starting from V.5.00 impersonate itself as _MSC_VER=1100, but miss some storage-class information specifiers, defined using the keyword '__declspec'.
When using standard headers same specifiers (usefull only to C++ and for this reason not present in PellesC) are used triggering warnings. To avoid the warnings edit 'windows.h' and add defines as showed:
#ifndef _WINDOWS_
#define _WINDOWS_
#ifdef __POCC__ //Add these 3 lines for PellesC
#define __declspec(selectany) //Add All missing specifiers that you can find
#endif
#include <sdkddkver.h>
#ifndef _INC_WINDOWS
#define _INC_WINDOWS
Up to now we are defining the 'selectany' specifier as nothing. This specifier is used in C++ to override multiple constructors/destructors definitions.
13. You have finished and can start to compile...
The main difference using the original MS headers is the compilation time, this bloated headers requires a lot more time
.
Because MS headers doesn't have the #pragma comment(lib, .... in many cases you have to specify manually the libraries needed.
This is a work in progress! You will not be able to compile everything.I have patched some other files thanks to the Timo's list.
This is only a part as this is a work in progress.
[Mpeg2data.h]
There is a C++ class operator on line 353. Comment out to make it work, but don't know if it is usable
//class DECLSPEC_UUID("DBAF6C1B-B6A4-4898-AE65-204F0D9509A1") Mpeg2DataLib;
----------------------------------------------------------------------------------------------------------------------------
[mpeg2psiparser]
Line 284 Redefinition of 'Initialize' property due to polimorhism change it to 'InitializeWord'
HRESULT ( STDMETHODCALLTYPE *InitializeWord )
Line 289 as above for 'GetLength' change to 'GetLengthWord'
HRESULT ( STDMETHODCALLTYPE *GetLengthWord )
----------------------------------------------------------------------------------------------------------------------------
[axextendenums.h]
You cannot include it together with atscpsipparser.h.
----------------------------------------------------------------------------------------------------------------------------
[netmon.h]
Lines 1422-1427 add space at end of line or surround lines with /* */ comment
Starting from line 2153 change
BYTE Byte[]; //... table of bytes follows
WORD Word[]; //... table of words follows
DWORD Dword[]; //... table of Dwords follows
LARGE_INTEGER LargeInt[]; //... table of LARGEINT structures to follow
SYSTEMTIME SysTime[]; //... table of SYSTEMTIME structures follows
TYPED_STRING TypedString;//... a typed_string that may have extended data
to
BYTE *Byte; //... table of bytes follows
WORD *Word; //... table of words follows
DWORD *Dword; //... table of Dwords follows
LARGE_INTEGER *LargeInt; //... table of LARGEINT structures to follow
SYSTEMTIME *SysTime; //... table of SYSTEMTIME structures follows
Starting from line 3234 change
BYTE Info[0]; //... information field.
WORD RoutingInfo[0]; //... routing information field.
to
BYTE *Info; //... information field.
WORD *RoutingInfo; //... routing information field.
Line 4846 change
RouterAE RAE[];
to
RouterAE *RAE;
----------------------------------------------------------------------------------------------------------------------------
[CertPolEng.h]
Requires other file inclusion and a definition:
#include <schannel.h>
#include <ntsecapi.h>
#include <lsalookup.h>
#define SECURITY_KERNEL
#include <sspi.h>
#include <ntsecpkg.h>
#include <CertPolEng.h>
----------------------------------------------------------------------------------------------------------------------------
[clfs.h]
No errors maybe ok by another fix.
----------------------------------------------------------------------------------------------------------------------------
[daogetrw.h]
Line 85, change
EXTERN_C typedef HRESULT (STDAPICALLTYPE *LPDAOBINDFUNC)(ULONG cb, DWORD dwUser, LPVOID *ppData);
to
#ifdef __cplusplus
EXTERN_C typedef HRESULT (STDAPICALLTYPE *LPDAOBINDFUNC)(ULONG cb, DWORD dwUser, LPVOID *ppData);
#else
typedef HRESULT (STDAPICALLTYPE *LPDAOBINDFUNC)(ULONG cb, DWORD dwUser, LPVOID *ppData);
#endif
----------------------------------------------------------------------------------------------------------------------------
[ddrawgdi.h]
Should require DirectX SDK. To check.
----------------------------------------------------------------------------------------------------------------------------
[dhcpsapi.h]
Conflicts with 'netmon.h' for symbol 'MAX_PATTERN_LENGTH' redefinition (a completely different meaning and value anyway).
There are alot of problems for this header as you can see
hereLine 1020 change
#endif _ST_SRVR_H_
to
#endif //_ST_SRVR_H_
Line 1047 change
#else MIDL_PASS
to
#else //MIDL_PASS
Line 1052 change
#endif MIDL_PASS
to
#endif //MIDL_PASS
----------------------------------------------------------------------------------------------------------------------------
[dhcpv6csdk.h]
Requires 'time.h' before it.
Line 70 change
#endif DHCPV6_OPTIONS_DEFINED
to
#endif //DHCPV6_OPTIONS_DEFINED
Line 83 change
#endif DHCPV6API_PARAMS_DEFINED
to
#endif //DHCPV6API_PARAMS_DEFINED
Line 189 change
#endif _DHCPV6CSDK_
to
#endif //_DHCPV6CSDK_
----------------------------------------------------------------------------------------------------------------------------
[Dispdib.h]
Requires 'windowsx.h'
----------------------------------------------------------------------------------------------------------------------------
[drt.h]
To be included as first before 'windows.h'
----------------------------------------------------------------------------------------------------------------------------
[DSAdmin.h]
Requires 'iads.h' included before.
Line 137 change
STDMETHOD(Commit)(THIS_ ) PURE;
to
STDMETHOD(Commit)(void) PURE;
Line 266 change
STDMETHOD(End)(THIS_) PURE;
to
STDMETHOD(End)(void) PURE;
----------------------------------------------------------------------------------------------------------------------------
[DSClient.h]
Requires 'shlobj.h'
----------------------------------------------------------------------------------------------------------------------------
Comment Lines 114 & 115
EXTERN_C
{
to
//EXTERN_C
//{
Comment line 216
}
to
//}
Line 224 Add comment after #endif
#endif __DTCHELP_H__
to
#endif //__DTCHELP_H__
----------------------------------------------------------------------------------------------------------------------------
[dvbsiparser.h]
Line 1161 Function polymorphism
HRESULT ( STDMETHODCALLTYPE *GetSDT )(
to
HRESULT ( STDMETHODCALLTYPE *GetSDT2 )(
Line 7832 Function polymorphism
HRESULT ( STDMETHODCALLTYPE *GetServiceProviderNameW )(
to
HRESULT ( STDMETHODCALLTYPE *GetServiceProviderNameExW )(