-
Notifications
You must be signed in to change notification settings - Fork 39
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
Could not instantiate org.graalvm.nativeimage.Platform$DARWIN_AMD64 #477
Comments
This can be fix by explicitly targeting org.graalvm.nativeimage.Platform$DARWIN_MACOS (my machine) |
@jperedadnr I am facing the same issue while building native executable for a JavaFX app on macOS platform. |
@RealThanhpv It did not work for me. Am I making any mistake? |
I do not like my solution, it is a kind of hard-code, and that is for my specific machine (arch). However you may miss the dependency of org.graalvm.sdk. You my need to choose the right one for you machine from org.graalvm.nativeimage.Platform.* |
@RealThanhpv Okay, so, I am using GitHub actions to perform the build process and it has x86_64 architecture and runs macOS 12 with XCode 14. but, how do I specify the right one for this runner from org.graalvm.nativeimage.Platform.*? |
I meant the target machine is my local machine so the arch is specific so I can hard-code. You are building with GitHub action on remote machine, I do not know how to be specific about the arch there but only os. I think you should get it succeed on local machine first. |
@RealThanhpv I mentioned that the macOS runner is having x86_64 architecture. So, isn't there any solution for that kind of machine? |
You may put these deps and try again with the hard-code of org.graalvm.nativeimage.Platform$DARWIN_MACOS I not currently building on Mac, I got it built a few months ago.
|
I followed the error to find this info, may be helpful for you:
|
@RealThanhpv I tried with these dependencies just now, but, the build failed with the same error message. I think that there is some problem in the org.graalvm.nativeimage.Platform$DARWIN_AMD64 java interface. GluonFX is failing to make an instance of that class. So, problem might lie with GluonFX SDK. |
It could not initiate org.graalvm.nativeimage.Platform$DARWIN_AMD64. DARWIN_AMD64 is not provided. So target MACOS_AMD64 with this look at this module
|
@RealThanhpv It worked for macOS but, in the link task, it failed for windows. [Mon Aug 14 15:04:50 UTC 2023][INFO] [SUB] Creating library D:\a\Drifty\Drifty\target\gluonfx\x86_64-windows\Drifty.lib and object D:\a\Drifty\Drifty\target\gluonfx\x86_64-windows\Drifty.exp
[Mon Aug 14 15:04:50 UTC 2023][INFO] [SUB] gui.launcher.obj : error LNK2001: unresolved external symbol Java_jdk_net_WindowsSocketOptions_getIpDontFragment0
[Mon Aug 14 15:04:50 UTC 2023][INFO] [SUB] gui.launcher.obj : error LNK2001: unresolved external symbol Java_jdk_net_WindowsSocketOptions_setIpDontFragment0
[Mon Aug 14 15:04:50 UTC 2023][INFO] [SUB] nio.lib(FileDispatcherImpl.obj) : error LNK2019: unresolved external symbol TransmitFile referenced in function Java_sun_nio_ch_FileDispatcherImpl_transferTo0
[Mon Aug 14 15:04:50 UTC 2023][INFO] [SUB] D:\a\Drifty\Drifty\target\gluonfx\x86_64-windows\Drifty.exe : fatal error LNK1120: 3 unresolved externals
[Mon Aug 14 15:04:50 UTC 2023][SEVERE] Process link failed with result: 1120 |
Can you please help me in this? |
Follow this: #456 (comment) |
Yes @RealThanhpv, I have read that. But, I could not understand how to implement the fix. How would I add the linker arg? Can you show me a configuration example? |
My pom.xml file is here. You can see I have created separate profiles for each OS-specific GUI build task. |
|
@RealThanhpv Should I place the |
@RealThanhpv When I run the /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x1b): undefined reference to `main'
collect2: error: ld returned 1 exit status How can I solve this? |
Yes. You compile a c code file into object files for platforms, accordingly. Those are platform dependent. So you should rename it. Google for compiling a C file to object files for platforms. You put it where ever you want as long as the linker can find for the link task. I made my simple choice. |
No. It is not an executable file, It is an object file. Compile it to .o file not .exe file. |
@RealThanhpv Okay, so, let me try it. Thank you for the help 😄 ! |
@RealThanhpv It worked! Thank you for your immense help 🙂 ! |
Welcome to JavaFX native image :) |
Hi I am not sure this the plugin or graalvm
MacOs Monterey, Intel Corei5
The text was updated successfully, but these errors were encountered: