编译OpenJDK11,遇到错误:
make[2]: *** [make/Main.gmk:272: hotspot-server-libs] Error 2 make[2]: *** Waiting for unfinished jobs.... Compiling 299 files for BUILD_jdk.javadoc.interim ERROR: Build failed for target 'default (exploded-image)' in configuration 'windows-x86_64-normal-server-release' (exit code 2) === Output from failing command(s) repeated here === * For target hotspot_variant-server_libjvm_gtest_objs_BUILD_GTEST_LIBJVM_pch.obj: BUILD_GTEST_LIBJVM_pch.cpp 注意: 包含文件: D:\Office-3.5-project\jdk11u\src\hotspot\share\precompiled\precompiled.hpp 注意: 包含文件: D:\Office-3.5-project\jdk11u\build\windows-x86_64-normal-server-release\support\modules_include\java.base\jni.h 注意: 包含文件: c:\progra~2\micros~3.0\vc\include\stdio.h 注意: 包含文件: c:\progra~2\micros~3.0\vc\include\crtdefs.h 注意: 包含文件: c:\progra~2\micros~3.0\vc\include\sal.h 注意: 包含文件: c:\progra~2\micros~3.0\vc\include\ConcurrencySal.h 注意: 包含文件: c:\progra~2\micros~3.0\vc\include\vadefs.h 注意: 包含文件: c:\progra~2\micros~3.0\vc\include\swprintf.inl 注意: 包含文件: c:\progra~2\micros~3.0\vc\include\stdarg.h 注意: 包含文件: D:\Office-3.5-project\jdk11u\build\windows-x86_64-normal-server-release\support\modules_include\java.base\win32\jni_md.h 注意: 包含文件: D:\Office-3.5-project\jdk11u\src\hotspot\share\include\jvm.h 注意: 包含文件: c:\progra~2\micros~3.0\vc\include\sys/stat.h 注意: 包含文件: c:\progra~2\micros~3.0\vc\include\crtdefs.h 注意: 包含文件: c:\progra~2\micros~3.0\vc\include\sys/types.h ... (rest of output omitted) * All command lines available in /cygdrive/d/Office-3.5-project/jdk11u/build/windows-x86_64-normal-server-release/make-support/failure-logs. === End of repeated output === No indication of failed target found. Hint: Try searching the build log for '] Error'. Hint: See doc/building.html#troubleshooting for assistance. make[1]: *** [/cygdrive/d/Office-3.5-project/jdk11u/make/Init.gmk:305: main] Error 2 make: *** [/cygdrive/d/Office-3.5-project/jdk11u/make/Init.gmk:186: default] Error 2
查看目录中的failure-logs错误文件,错误如下:
D:\Office-3.5-project\jdk11u\src\hotspot\share\utilities/globalDefinitions_visCPP.hpp(46) : fatal error C1083: 无法打开包括文件:“inttypes.h”: No such file or directory
解决办法
inttypes.h源码,VS编译需要_柳鲲鹏的博客-CSDN博客