gluonhq / gluon-samples

Gluon sample projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gluonfx:link fails on windows 10 x64

dskgry opened this issue · comments

Hi,
I followed the instructions here to create a native build of the HelloFX project on windows.
The mvn gluonfx:compile task succeeds but the linking fails with the following error:

error LNK2019: unresolved external symbol __imp_WinHttpOpen referenced in function Java_sun_net_spi_DefaultProxySelector_init
net.lib(DefaultProxySelector.obj) : error LNK2019: unresolved external symbol __imp_WinHttpGetProxyForUrl referenced in function Java_sun_net_spi_DefaultProxySelector_getSystemProxies
net.lib(DefaultProxySelector.obj) : error LNK2019: unresolved external symbol __imp_WinHttpGetIEProxyConfigForCurrentUser referenced in function Java_sun_net_spi_DefaultProxySelector_getSystemProxies
C:\Users\abc\gluon-samples-master\HelloFX\target\gluonfx\x86_64-windows\HelloFX.exe : fatal error LNK1120: 3 unresolved externals

This is the full process-link output:

Process

link

Command Line

link C:\Users\abc\gluon-samples-master\HelloFX\target\gluonfx\x86_64-windows\gvm\HelloFX\launcher.obj C:\Users\abc\gluon-samples-master\HelloFX\target\gluonfx\x86_64-windows\gvm\tmp\SVM-1624625182797\hellofx.hellofx.obj advapi32.lib iphlpapi.lib secur32.lib userenv.lib version.lib ws2_32.lib j2pkcs11.lib java.lib net.lib nio.lib prefs.lib fdlibm.lib sunec.lib zip.lib jvm.lib libchelper.lib /NODEFAULTLIB:libcmt.lib /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup comdlg32.lib dwmapi.lib gdi32.lib imm32.lib shell32.lib uiautomationcore.lib urlmon.lib winmm.lib glass.lib javafx_font.lib javafx_iio.lib prism_common.lib prism_d3d.lib /WHOLEARCHIVE:glass.lib /WHOLEARCHIVE:javafx_font.lib /WHOLEARCHIVE:javafx_iio.lib /WHOLEARCHIVE:prism_common.lib /WHOLEARCHIVE:prism_d3d.lib /OUT:C:\Users\abc\gluon-samples-master\HelloFX\target\gluonfx\x86_64-windows\HelloFX.exe /LIBPATH:C:\Users\abc.gluon\substrate\javafxStaticSdk\17-ea+11\windows-x86_64\sdk\lib /LIBPATH:C:\Program Files\Java\graalvm-svm-windows-gluon-21.2.0-dev\lib\svm\clibraries\windows-amd64 /LIBPATH:C:\Program Files\Java\graalvm-svm-windows-gluon-21.2.0-dev\lib\static\windows-amd64

Output

Microsoft (R) Incremental Linker Version 14.29.30038.1
Copyright (C) Microsoft Corporation. All rights reserved.

Creating library C:\Users\abc\gluon-samples-master\HelloFX\target\gluonfx\x86_64-windows\HelloFX.lib and object C:\Users\abc\gluon-samples-master\HelloFX\target\gluonfx\x86_64-windows\HelloFX.exp
net.lib(DefaultProxySelector.obj) : error LNK2019: unresolved external symbol __imp_WinHttpOpen referenced in function Java_sun_net_spi_DefaultProxySelector_init
net.lib(DefaultProxySelector.obj) : error LNK2019: unresolved external symbol __imp_WinHttpGetProxyForUrl referenced in function Java_sun_net_spi_DefaultProxySelector_getSystemProxies
net.lib(DefaultProxySelector.obj) : error LNK2019: unresolved external symbol __imp_WinHttpGetIEProxyConfigForCurrentUser referenced in function Java_sun_net_spi_DefaultProxySelector_getSystemProxies
C:\Users\abc\gluon-samples-master\HelloFX\target\gluonfx\x86_64-windows\HelloFX.exe : fatal error LNK1120: 3 unresolved externals

Result

result: 1120

Thank you

Please update your Graalvm to very latest dev version e.g. GraalVM CE Gluon 21.2.0-dev-20210621_1207 form here.

Previous version have such error, also try to use latest gluonfx-maven-plugin version currently is 1.0.1

Hi,
thanks for the reply.

I tried the very latest dev version and the latest maven plugin but the exact same error still occurs.

Any other hints?

@dskgry Please send the output of java -version command

As I know same problem was exists here, but was fixed soon see here, gluonhq/gluonfx-maven-plugin#348

I am using latest client plugin with latest graalvm without any issue

The version is:

openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment GraalVM 21.2.0-dev (build 11.0.11+8-jvmci-21.2-b02)
OpenJDK 64-Bit Server VM GraalVM 21.2.0-dev (build 11.0.11+8-jvmci-21.2-b02, mixed mode, sharing)

It does work when I use the latest 21.1 version (https://github.com/gluonhq/graal/releases/tag/21.1.0-dev-20210415_0700)

But none of the 21.2 versions work

@ctoabidmaqbool my issue (gluonhq/gluonfx-maven-plugin#348) is closed, but if one uses "GraalVM CE Gluon 21.2.0-dev-20210621_1207" release with gluon maven plugin v1.0.1 - build of sample projects will result in error (as is noticed in this issue)

I can add to @dskgry statement: using "GraalVM CE Gluon 21.1.0-dev-20210415_0700" on Windows 7 x64, sample projects "HelloFX" and "HelloFXML" are build correctly.

Solution - as Jose Pereda explained, we should wait new release of SubstrateVM or use modified gluon plugin - it worked for me (see comment gluonhq/gluonfx-maven-plugin#348 (comment))

Fixed with GluonFX 1.0.3