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

Build failure with VS 2019 (16.5.0) due to C2039 and C2873

XMLWordPrintable

    • b19
    • windows

        I tried to build OpenJDK with VS 2019 (version 16.5.0), but it failed as below (I have my laptop with Japanese locale only, sorry):

        ```
        c:\progra~2\micros~4\2019\profes~1\vc\tools\msvc\1425~1.286\include\cstdlib(46): error C2039: 'Do_Not_Use_calloc_Use_safe_Calloc_Instead': '`global namespace'' のメンバーではありません
        c:\progra~2\micros~4\2019\profes~1\vc\tools\msvc\1425~1.286\include\cstdlib(46): error C2873: 'Do_Not_Use_calloc_Use_safe_Calloc_Instead': シンボルを using 宣言の中で使用することはできません。
        c:\progra~2\micros~4\2019\profes~1\vc\tools\msvc\1425~1.286\include\cstdlib(52): error C2039: 'Do_Not_Use_malloc_Use_safe_Malloc_Instead': '`global namespace'' のメンバーではありません
        c:\progra~2\micros~4\2019\profes~1\vc\tools\msvc\1425~1.286\include\cstdlib(52): error C2873: 'Do_Not_Use_malloc_Use_safe_Malloc_Instead': シンボルを using 宣言の中で使用することはできません。
        c:\progra~2\micros~4\2019\profes~1\vc\tools\msvc\1425~1.286\include\cstdlib(58): error C2039: 'Do_Not_Use_realloc_Use_safe_Realloc_Instead': '`global namespace'' のメンバーではありません
        c:\progra~2\micros~4\2019\profes~1\vc\tools\msvc\1425~1.286\include\cstdlib(58): error C2873: 'Do_Not_Use_realloc_Use_safe_Realloc_Instead': シンボルを using 宣言の中で使用することはできません。
        ```

        alloc.h defines malloc / calloc / realloc to undeclared value not for using them. They seem to affect to C++ runtime internal call (in cstdlib).

        We have to tweak order of including header files.

              ysuenaga Yasumasa Suenaga
              ysuenaga Yasumasa Suenaga
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: