Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Native Image] Got 2 unresolved external symbol while building Native Image #10426

Open
1 task
MoritzArena opened this issue Jan 7, 2025 · 2 comments
Open
1 task
Assignees

Comments

@MoritzArena
Copy link

Describe the Issue

I am adapting GraalVM for Nacos. In the past, I was able to successfully package the Native Image binary program through GraalVM on the Windows 11 platform. However, after I upgraded Visual Studio, a build error occurred. Specifically, it was missing two link symbols:

  1. __imp_SHGetFolderPathW referenced in function getHomeFromShell32
  2. SHGetKnownFolderPath referenced in function getHomeFromShell32

These problems only occur on the Windows 11 platform. The binary file can be packaged normally on Linux. My environment information is as follows:

Name Value
Java version 17.0.13+10-LTS
Vendor version Oracle GraalVM 17.0.13+10.1
Runtime version 17.0.13+10-LTS-jvmci-23.0-b49
C compiler cl.exe (microsoft, x64, 19.42.34435)

Please confirm if you have tested with the latest available version.

Share the svm_err_b_*.md File

svm_err_b_20250107T234343.404_pid9276.md

Additional Context

No response

@selhagani
Copy link
Member

Hi @MoritzArena,

Thank you for reaching out to us about this. Could you please provide us with a reproducer alongside the steps needed to encounter the issue?

@MoritzArena
Copy link
Author

Hi @MoritzArena,

Thank you for reaching out to us about this. Could you please provide us with a reproducer alongside the steps needed to encounter the issue?

No problem, the relevant code has been pushed to the official repository of nacos. You can build the GraalVM binary file by following the steps below:

  1. clone https://github.com/alibaba/nacos.git
  2. switch git branch to summer-ospp#12028
  3. run command mvn clean install -Pnative -Pnative-win64 -DskipTests=true

I encountered a build problem in the following environment:

Name Value
OS version Windows 11 Pro 24H2 26100.2605
Java version 17.0.13+10-LTS
Vendor version Oracle GraalVM 17.0.13+10.1
Runtime version 17.0.13+10-LTS-jvmci-23.0-b49
C compiler cl.exe (microsoft, x64, 19.42.34435)
Visual Studio Community version 2022 17.12.3
Visual Studio Build Tools version 2019 16.11.42
Windows 11 SDK version 10.0.22621.0

I have encountered this problem on Windows 11 before. Later, I reinstalled my operating system and reinstalled all the environments, but I still encountered this problem.

@selhagani selhagani self-assigned this Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants