编译OpenJDK11:fatal error LNK1104: cannot open file ‘kernel32.lib‘

简介: 编译OpenJDK11:fatal error LNK1104: cannot open file ‘kernel32.lib‘

报错

checking resolved symbolic links for CC... no symlink
configure: Using microsoft C compiler version 18.00.31101 [Microsoft (R) C/C++ Optimizing Compiler Version 18.00.31101 for x64]
checking whether the C compiler works... no
configure: error: in `/cygdrive/d/Office-3.5-project/tsjdk11-project/ts-jdk11':
configure: error: C compiler cannot create executables
See `config.log' for more details
configure exiting with result code 77

检查config.log

忽略cl --version/cl -V/cl -qversion之类的错误,定位:


configure:36611: checking whether the C compiler works
configure:36633: /cygdrive/c/progra~2/micros~1.0/vc/bin/amd64/cl        conftest.c  >&5
Microsoft (R) C/C++ Optimizing Compiler Version 18.00.31101 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.
conftest.c
Microsoft (R) Incremental Linker Version 12.00.31101.0
Copyright (C) Microsoft Corporation.  All rights reserved.
/out:conftest.exe 
conftest.obj 
LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
configure:36637: $? = 2
configure:36675: result: no
configure: failed program was:

VS解决办法

原因当前的lib路径中,找不到kernel32.lib。


搜索了一下,说是给VS项目加上路径,项目属性->配置属性->VC++目录->库目录,添加二选一:


C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib


C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib\x64


JDK11编译解决办法1

修改了toolchain_windows.m4,484处增加了一句:


VS_LIB="$VS_LIB;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib\x64"


JDK11编译解决办法2

能不能修改什么变量,让其自动读取到?

目录
相关文章
|
编解码 C++ Python
成功解决LINK : fatal error LNK1181: 无法打开输入文件“avdevice.lib” error: command 'D:\\Program Files (x86)\\Micr
成功解决LINK : fatal error LNK1181: 无法打开输入文件“avdevice.lib” error: command 'D:\\Program Files (x86)\\Micr
成功解决LINK : fatal error LNK1181: 无法打开输入文件“avdevice.lib” error: command 'D:\\Program Files (x86)\\Micr
|
3月前
|
Ubuntu
Ubuntu22.04,AOSP编译报错: libncurses.so.5: cannot open shared object file: No such file
本文描述了在Ubuntu 22.04系统上编译AOSP时遇到的`libncurses.so.5`缺失错误,并提供了通过安装相应库解决该问题的步骤。
341 0
fatal error: jni.h: No such file or directory
fatal error: jni.h: No such file or directory
153 0
LINK : fatal error LNK1181: 无法打开输入文件“a.lib,b.lib” 可能原因是什么?
LINK : fatal error LNK1181: 无法打开输入文件“a.lib,b.lib” 可能原因是什么?
|
Android开发
【错误记录】NDK 动态库报错 ( dlopen failed: file offset for the library /lib/arm64/libwebp.so“ >= file size:0)
【错误记录】NDK 动态库报错 ( dlopen failed: file offset for the library /lib/arm64/libwebp.so“ >= file size:0)
452 0
【错误记录】NDK 动态库报错 ( dlopen failed: file offset for the library /lib/arm64/libwebp.so“ >= file size:0)
|
C语言 Python Windows
gcc: error: /FIPython.h: File o directory non esistente
gcc: error: /FIPython.h: File o directory non esistente
116 0
|
Windows
WINDOWS编译ffmpeg:LINK : fatal error LNK1104: 无法打开文件“LIBCMT.lib”
WINDOWS编译ffmpeg:LINK : fatal error LNK1104: 无法打开文件“LIBCMT.lib”
447 0
|
C++
cygwin/msys: fatal error LNK1104: 无法打开文件“kernel32.lib”
cygwin/msys: fatal error LNK1104: 无法打开文件“kernel32.lib”
156 0
fatal error: alsa/asoundlib.h: 没有那个文件或目录
fatal error: alsa/asoundlib.h: 没有那个文件或目录
154 0