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

Windows: link error: unresolved external symbol "int __cdecl convert_to_unicode(char const *,wchar_t * *)"

XMLWordPrintable

    • b02
    • 18
    • b03
    • x86
    • windows

        After the changes in JDK-8238649 some users are experience a build error:

        On 17/06/2021 9:47 am, Vitaly Provodin wrote:
        > Hi all,
        >
        > Building OpenJDK on Windows I am faced with the following error
        >
        > ---------------------------8<---------------------------
        > os_windows.obj : error LNK2019: unresolved external symbol "int __cdecl convert_to_unicode(char const *,wchar_t * *)" (?convert_to_unicode@@YAHPEBDPEAPEA_W@Z) referenced in function "public: static void __cdecl os::set_native_thread_name(char const *)" (?set_native_thread_name@os@@SAXPEBD@Z)
        > c:\buildagent\work\d0555747f6bd5c6\build\windows-x86_64-server-release\support\modules_libs\java.base\server\jvm.dll : fatal error LNK1120: 1 unresolved externals

        This is not seen by all users.

        convert_to_unicode is a static function in os_windows.cpp and was used prior to this recent change with set_native_thread_name(). The only difference is that we declared a function prototype for it, as a forward declaration, as it is defined later in the file. It seems the prototype and the definition are subtly different, leading to the linker thinking this is an external reference.

              dholmes David Holmes
              dholmes David Holmes
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: