栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

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

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

编译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 SDKsWindowsv7.1ALib

C:Program Files (x86)Microsoft SDKsWindowsv7.1ALibx64

  • JDK11编译解决办法1

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

VS_LIB="$VS_LIB;C:Program Files (x86)Microsoft SDKsWindowsv7.1ALibx64"

  • JDK11编译解决办法2

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

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/943632.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号