mstorsjo/llvm-mingw

Missing `CLIPFORMAT` (and others) from `objbase.h` and `objidl.h`

falhumai96 opened this issue · 6 comments

I am trying to build APR (Apache Portable Runtime) using MinGW from Vcpkg, and it reports the following errors:

Change Dir: 'C:/Users/devuser/vcpkg/buildtrees/apr/x64-mingw-static-dbg'

Run Build Command(s): "C:/Program Files/Ninja/ninja.exe" -v -v -j9 install
[1/84] C:\PROGRA~1\LLVMMI~1\NIGHTL~1\bin\X8EAA8~1.EXE --target=x86_64-windows-gnu  -IC:/Users/devuser/vcpkg/buildtrees/apr/x64-mingw-static-dbg -IC:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include -IC:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/win32 -IC:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/unix -IC:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/private -g -MD -MT CMakeFiles/gen_test_char.dir/tools/gen_test_char.c.obj -MF CMakeFiles\gen_test_char.dir\tools\gen_test_char.c.obj.d -o CMakeFiles/gen_test_char.dir/tools/gen_test_char.c.obj -c C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/tools/gen_test_char.c
[2/84] C:\Windows\system32\cmd.exe /C "cd . && C:\PROGRA~1\LLVMMI~1\NIGHTL~1\bin\X8EAA8~1.EXE --target=x86_64-windows-gnu -g  CMakeFiles/gen_test_char.dir/tools/gen_test_char.c.obj -o gen_test_char.exe -Wl,--out-implib,libgen_test_char.dll.a -Wl,--major-image-version,0,--minor-image-version,0  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
[3/84] C:\PROGRA~1\LLVMMI~1\NIGHTL~1\bin\X8EAA8~1.EXE --target=x86_64-windows-gnu -DAPR_APP -DAPR_DECLARE_STATIC -DWINNT -IC:/Users/devuser/vcpkg/buildtrees/apr/x64-mingw-static-dbg -IC:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include -IC:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/win32 -IC:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/unix -IC:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/private -g -MD -MT CMakeFiles/aprapp-1.dir/misc/win32/apr_app.c.obj -MF CMakeFiles\aprapp-1.dir\misc\win32\apr_app.c.obj.d -o CMakeFiles/aprapp-1.dir/misc/win32/apr_app.c.obj -c C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/misc/win32/apr_app.c
FAILED: CMakeFiles/aprapp-1.dir/misc/win32/apr_app.c.obj
C:\PROGRA~1\LLVMMI~1\NIGHTL~1\bin\X8EAA8~1.EXE --target=x86_64-windows-gnu -DAPR_APP -DAPR_DECLARE_STATIC -DWINNT -IC:/Users/devuser/vcpkg/buildtrees/apr/x64-mingw-static-dbg -IC:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include -IC:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/win32 -IC:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/unix -IC:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/private -g -MD -MT CMakeFiles/aprapp-1.dir/misc/win32/apr_app.c.obj -MF CMakeFiles\aprapp-1.dir\misc\win32\apr_app.c.obj.d -o CMakeFiles/aprapp-1.dir/misc/win32/apr_app.c.obj -c C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/misc/win32/apr_app.c
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/misc/win32/apr_app.c:38:
C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/apr_general.h:118:9: warning: 'strcasecmp' macro redefined [-Wmacro-redefined]
  118 | #define strcasecmp(s1, s2) stricmp(s1, s2)
      |         ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/string.h:120:9: note: previous definition is here
  120 | #define strcasecmp _stricmp
      |         ^
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/misc/win32/apr_app.c:38:
C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/apr_general.h:124:9: warning: 'strncasecmp' macro redefined [-Wmacro-redefined]
  124 | #define strncasecmp(s1, s2, n) strnicmp(s1, s2, n)
      |         ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/string.h:119:9: note: previous definition is here
  119 | #define strncasecmp _strnicmp
      |         ^
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/misc/win32/apr_app.c:41:
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/win32/apr_arch_file_io.h:21:
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/win32/apr_private.h:52:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/accctrl.h:10:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/wtypes.h:13:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/ole2.h:17:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objbase.h:66:
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objidl.h:9546:9: error: unknown type name 'CLIPFORMAT'
 9546 | typedef CLIPFORMAT *LPCLIPFORMAT;
      |         ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objidl.h:9548:5: error: unknown type name 'CLIPFORMAT'
 9548 |     CLIPFORMAT cfFormat;
      |     ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objidl.h:9954:9: error: unknown type name 'HMETAFILEPICT'; did you mean 'METAFILEPICT'?
 9954 |         HMETAFILEPICT hMetaFilePict;
      |         ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/wingdi.h:748:5: note: 'METAFILEPICT' declared here
  748 |   } METAFILEPICT,*LPMETAFILEPICT;
      |     ^
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/misc/win32/apr_app.c:41:
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/win32/apr_arch_file_io.h:21:
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/win32/apr_private.h:52:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/accctrl.h:10:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/wtypes.h:13:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/ole2.h:17:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objbase.h:66:
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objidl.h:9967:9: error: unknown type name 'wireHBITMAP'
 9967 |         wireHBITMAP hBitmap;
      |         ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objidl.h:9968:9: error: unknown type name 'wireHPALETTE'; did you mean 'HPALETTE'?
 9968 |         wireHPALETTE hPalette;
      |         ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/windef.h:54:16: note: 'HPALETTE' declared here
   54 | DECLARE_HANDLE(HPALETTE);
      |                ^
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/misc/win32/apr_app.c:41:
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/win32/apr_arch_file_io.h:21:
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/win32/apr_private.h:52:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/accctrl.h:10:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/wtypes.h:13:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/ole2.h:17:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objbase.h:66:
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objidl.h:9969:9: error: unknown type name 'wireHGLOBAL'
 9969 |         wireHGLOBAL hGeneric;
      |         ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objidl.h:9976:13: error: unknown type name 'wireHMETAFILEPICT'
 9976 |             wireHMETAFILEPICT hMetaFilePict;
      |             ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objidl.h:9977:13: error: unknown type name 'wireHENHMETAFILE'; did you mean 'HENHMETAFILE'?
 9977 |             wireHENHMETAFILE hHEnhMetaFile;
      |             ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/windef.h:50:16: note: 'HENHMETAFILE' declared here
   50 | DECLARE_HANDLE(HENHMETAFILE);
      |                ^
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/misc/win32/apr_app.c:41:
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/win32/apr_arch_file_io.h:21:
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/win32/apr_private.h:52:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/accctrl.h:10:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/wtypes.h:13:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/ole2.h:17:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objbase.h:66:
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objidl.h:9979:13: error: unknown type name 'wireHGLOBAL'
 9979 |             wireHGLOBAL hGlobal;
      |             ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objidl.h:12808:69: error: unknown type name 'CLIPFORMAT'
 12808 | ULONG           __RPC_USER CLIPFORMAT_UserSize     (ULONG *, ULONG, CLIPFORMAT *);
       |                                                                     ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objidl.h:12809:79: error: unknown type name 'CLIPFORMAT'
 12809 | unsigned char * __RPC_USER CLIPFORMAT_UserMarshal  (ULONG *, unsigned char *, CLIPFORMAT *);
       |                                                                               ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objidl.h:12810:79: error: unknown type name 'CLIPFORMAT'
 12810 | unsigned char * __RPC_USER CLIPFORMAT_UserUnmarshal(ULONG *, unsigned char *, CLIPFORMAT *);
       |                                                                               ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objidl.h:12811:62: error: unknown type name 'CLIPFORMAT'
 12811 | void            __RPC_USER CLIPFORMAT_UserFree     (ULONG *, CLIPFORMAT *);
       |                                                              ^
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/misc/win32/apr_app.c:41:
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/win32/apr_arch_file_io.h:21:
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/win32/apr_private.h:52:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/accctrl.h:10:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/wtypes.h:13:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/ole2.h:17:
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objbase.h:159:52: error: unknown type name 'uCLSSPEC'
  159 | WINOLEAPI CoInstall (IBindCtx *pbc, DWORD dwFlags, uCLSSPEC *pClassSpec, QUERYCONTEXT *pQuery, LPWSTR pszCodeBase);
      |                                                    ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objbase.h:159:74: error: unknown type name 'QUERYCONTEXT'; did you mean 'PUMS_CONTEXT'?
  159 | WINOLEAPI CoInstall (IBindCtx *pbc, DWORD dwFlags, uCLSSPEC *pClassSpec, QUERYCONTEXT *pQuery, LPWSTR pszCodeBase);
      |                                                                          ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/winbase.h:1233:17: note: 'PUMS_CONTEXT' declared here
 1233 |   typedef void *PUMS_CONTEXT;
      |                 ^
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/misc/win32/apr_app.c:41:
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/win32/apr_arch_file_io.h:21:
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/win32/apr_private.h:52:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/accctrl.h:10:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/wtypes.h:13:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/ole2.h:17:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objbase.h:163:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/urlmon.h:456:
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/oleidl.h:1328:9: error: unknown type name 'LPMSG'
 1328 |         LPMSG lpmsg,
      |         ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/oleidl.h:2198:9: error: unknown type name 'LPMSG'
 2198 |         LPMSG lpmsg);

      |         ^

C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/oleidl.h:2299:5: error: unknown type name 'LPMSG'

 2299 |     LPMSG lpmsg);

      |     ^

C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/oleidl.h:2441:9: error: unknown type name 'LPMSG'

 2441 |         LPMSG lpmsg,

      |         ^

fatal error: too many errors emitted, stopping now [-ferror-limit=]

2 warnings and 20 errors generated.

[4/84] C:\PROGRA~1\LLVMMI~1\NIGHTL~1\bin\X8EAA8~1.EXE --target=x86_64-windows-gnu -DAPR_APP -DAPR_DECLARE_STATIC -DWINNT -IC:/Users/devuser/vcpkg/buildtrees/apr/x64-mingw-static-dbg -IC:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include -IC:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/win32 -IC:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/unix -IC:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/private -g -MD -MT CMakeFiles/aprapp-1.dir/misc/win32/internal.c.obj -MF CMakeFiles\aprapp-1.dir\misc\win32\internal.c.obj.d -o CMakeFiles/aprapp-1.dir/misc/win32/internal.c.obj -c C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/misc/win32/internal.c
FAILED: CMakeFiles/aprapp-1.dir/misc/win32/internal.c.obj
C:\PROGRA~1\LLVMMI~1\NIGHTL~1\bin\X8EAA8~1.EXE --target=x86_64-windows-gnu -DAPR_APP -DAPR_DECLARE_STATIC -DWINNT -IC:/Users/devuser/vcpkg/buildtrees/apr/x64-mingw-static-dbg -IC:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include -IC:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/win32 -IC:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/unix -IC:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/private -g -MD -MT CMakeFiles/aprapp-1.dir/misc/win32/internal.c.obj -MF CMakeFiles\aprapp-1.dir\misc\win32\internal.c.obj.d -o CMakeFiles/aprapp-1.dir/misc/win32/internal.c.obj -c C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/misc/win32/internal.c
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/misc/win32/internal.c:17:
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/win32/apr_private.h:52:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/accctrl.h:10:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/wtypes.h:13:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/ole2.h:17:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objbase.h:66:
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objidl.h:9546:9: error: unknown type name 'CLIPFORMAT'
 9546 | typedef CLIPFORMAT *LPCLIPFORMAT;
      |         ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objidl.h:9548:5: error: unknown type name 'CLIPFORMAT'
 9548 |     CLIPFORMAT cfFormat;
      |     ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objidl.h:9954:9: error: unknown type name 'HMETAFILEPICT'; did you mean 'METAFILEPICT'?
 9954 |         HMETAFILEPICT hMetaFilePict;
      |         ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/wingdi.h:748:5: note: 'METAFILEPICT' declared here
  748 |   } METAFILEPICT,*LPMETAFILEPICT;
      |     ^
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/misc/win32/internal.c:17:
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/win32/apr_private.h:52:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/accctrl.h:10:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/wtypes.h:13:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/ole2.h:17:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objbase.h:66:
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objidl.h:9967:9: error: unknown type name 'wireHBITMAP'
 9967 |         wireHBITMAP hBitmap;
      |         ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objidl.h:9968:9: error: unknown type name 'wireHPALETTE'; did you mean 'HPALETTE'?
 9968 |         wireHPALETTE hPalette;
      |         ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/windef.h:54:16: note: 'HPALETTE' declared here
   54 | DECLARE_HANDLE(HPALETTE);
      |                ^
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/misc/win32/internal.c:17:
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/win32/apr_private.h:52:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/accctrl.h:10:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/wtypes.h:13:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/ole2.h:17:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objbase.h:66:
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objidl.h:9969:9: error: unknown type name 'wireHGLOBAL'
 9969 |         wireHGLOBAL hGeneric;
      |         ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objidl.h:9976:13: error: unknown type name 'wireHMETAFILEPICT'
 9976 |             wireHMETAFILEPICT hMetaFilePict;
      |             ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objidl.h:9977:13: error: unknown type name 'wireHENHMETAFILE'; did you mean 'HENHMETAFILE'?
 9977 |             wireHENHMETAFILE hHEnhMetaFile;
      |             ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/windef.h:50:16: note: 'HENHMETAFILE' declared here
   50 | DECLARE_HANDLE(HENHMETAFILE);
      |                ^
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/misc/win32/internal.c:17:
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/win32/apr_private.h:52:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/accctrl.h:10:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/wtypes.h:13:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/ole2.h:17:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objbase.h:66:
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objidl.h:9979:13: error: unknown type name 'wireHGLOBAL'
 9979 |             wireHGLOBAL hGlobal;
      |             ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objidl.h:12808:69: error: unknown type name 'CLIPFORMAT'
 12808 | ULONG           __RPC_USER CLIPFORMAT_UserSize     (ULONG *, ULONG, CLIPFORMAT *);
       |                                                                     ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objidl.h:12809:79: error: unknown type name 'CLIPFORMAT'
 12809 | unsigned char * __RPC_USER CLIPFORMAT_UserMarshal  (ULONG *, unsigned char *, CLIPFORMAT *);
       |                                                                               ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objidl.h:12810:79: error: unknown type name 'CLIPFORMAT'
 12810 | unsigned char * __RPC_USER CLIPFORMAT_UserUnmarshal(ULONG *, unsigned char *, CLIPFORMAT *);
       |                                                                               ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objidl.h:12811:62: error: unknown type name 'CLIPFORMAT'
 12811 | void            __RPC_USER CLIPFORMAT_UserFree     (ULONG *, CLIPFORMAT *);
       |                                                              ^
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/misc/win32/internal.c:17:
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/win32/apr_private.h:52:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/accctrl.h:10:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/wtypes.h:13:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/ole2.h:17:
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objbase.h:159:52: error: unknown type name 'uCLSSPEC'
  159 | WINOLEAPI CoInstall (IBindCtx *pbc, DWORD dwFlags, uCLSSPEC *pClassSpec, QUERYCONTEXT *pQuery, LPWSTR pszCodeBase);
      |                                                    ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objbase.h:159:74: error: unknown type name 'QUERYCONTEXT'; did you mean 'PUMS_CONTEXT'?
  159 | WINOLEAPI CoInstall (IBindCtx *pbc, DWORD dwFlags, uCLSSPEC *pClassSpec, QUERYCONTEXT *pQuery, LPWSTR pszCodeBase);
      |                                                                          ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/winbase.h:1233:17: note: 'PUMS_CONTEXT' declared here
 1233 |   typedef void *PUMS_CONTEXT;
      |                 ^
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/misc/win32/internal.c:17:
In file included from C:/Users/devuser/vcpkg/buildtrees/apr/src/apr-1-bab9b0bb9d.clean/include/arch/win32/apr_private.h:52:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/accctrl.h:10:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/wtypes.h:13:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/ole2.h:17:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/objbase.h:163:
In file included from C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/urlmon.h:456:
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/oleidl.h:1328:9: error: unknown type name 'LPMSG'
 1328 |         LPMSG lpmsg,
      |         ^
C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/oleidl.h:2198:9: error: unknown type name 'LPMSG'

 2198 |         LPMSG lpmsg);

      |         ^

C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/oleidl.h:2299:5: error: unknown type name 'LPMSG'

 2299 |     LPMSG lpmsg);

      |     ^

C:/PROGRA~1/LLVMMI~1/NIGHTL~1/include/oleidl.h:2441:9: error: unknown type name 'LPMSG'

 2441 |         LPMSG lpmsg,

      |         ^

fatal error: too many errors emitted, stopping now [-ferror-limit=]

20 errors generated.

[5/84] C:\Windows\system32\cmd.exe /C "cd /D C:\Users\devuser\vcpkg\buildtrees\apr\x64-mingw-static-dbg && C:\Users\devuser\vcpkg\buildtrees\apr\x64-mingw-static-dbg\gen_test_char.exe > C:/Users/devuser/vcpkg/buildtrees/apr/x64-mingw-static-dbg/apr_escape_test_char.h"
ninja: build stopped: subcommand failed.

The items missing (e.g. CLIPFORMAT) are in wtypes.h, and in the include hierarchy this files seems to be included. However, missing such types are reported as errors as seen above.

Btw, the targets I have tested building for are x64-mingw-static and x64-mingw-dynamic (the one shown above is from the former, but they both report the same errors). Not sure if this is a Vcpkg issue or this toolchain's issue. Bummer, APR is such a great library and I was hoping to use it with the MinGW toolchain (MSVC builds just fine). It simplifies cross-plat dev.

This does not seem an issue with llvm-mingw or clang. APR can be compiled with some patches using mingw-w64 toolchain, see the apr_wtypes.patch in https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-apr

This does not seem an issue with llvm-mingw or clang. APR can be compiled with some patches using mingw-w64 toolchain, see the apr_wtypes.patch in https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-apr

Thank you for your reply.

Yes, I have just located the MinGW patches in MSYS2 tonight, and converted them to git patches to be submitted to Vcpkg. I will be submitting the following patches, which are identical to the patches found in https://github.com/msys2/MINGW-packages/tree/1f05e92bf7f5d7194bcfd85e3078a4d7ee0144b1/mingw-w64-apr:

apr-pacthes.zip

However, I'm still encountering build issues in LLVM MinGW such as implicit-int warning being treated as an error. Do you have a set of patches for the Clang64 toolchain in MSYS2 for APR?

It could be possible to disable those warnings with compiler flags. I would suggest to upstream any changes if required.

By the way, I am not sure if that apr_wtypes.patch is valid or it should be applied. That patch is 10 years old and untouched as of writing this comment.

Also, the actual underlying issue could be in mingw-w64 headers. Contributions are welcomed.

The mingw apr package is built using autotools build system. The build procedure can be found in PKGBUILD file https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-apr/PKGBUILD