Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8236125

Windows (MSVC 2013) build fails in jpackage: Need to include strsafe.h after tchar.h

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 15
    • 14, 15
    • tools
    • b06

        * For target support_native_jdk.incubator.jpackage_libjpackage_WindowsRegistry.obj:
        WindowsRegistry.cpp
        c:\progra~2\micros~1.0\vc\include\tchar.h(24) : fatal error C1189: #error : Need to include strsafe.h after tchar.h
           ... (rest of output omitted)

        Simple fix is to change the order of includes as error message wants it:

        diff -r b8b54ebb450a src/jdk.incubator.jpackage/windows/native/libjpackage/WindowsRegistry.cpp
        --- a/src/jdk.incubator.jpackage/windows/native/libjpackage/WindowsRegistry.cpp Tue Dec 17 10:00:55 2019 +0900
        +++ b/src/jdk.incubator.jpackage/windows/native/libjpackage/WindowsRegistry.cpp Tue Dec 17 21:42:11 2019 +0300
        @@ -24,8 +24,8 @@
          */
         
         #include <Windows.h>
        +#include <tchar.h>
         #include <strsafe.h>
        -#include <tchar.h>
         #include <jni.h>
         
         #include "Utils.h"

              akasko Alex Kasko
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: