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
Can't Convert jar to dll #517
Comments
Did you "Make sure the appropriate reference assemblies for the target environment are included?" |
Can you clarify? What "core library" are we talking about? What "target environment" are we talking about? What are the "appropriate reference assemblies"? Please don't assume that everyone understands how your app works. |
I compiled a utility library using Java 1.8, and then executed the command 'ikvmc -target:library wxbot1.1.jar' via the command line. I used the latest version 8.8 of IKVM.Tools. However, it threw the above error. The JAR file contains dependencies and can be executed correctly. I don't know if what you're saying is about needing me to include something in the Java package. |
Every assembly that is part of the target framework you are attempting to link to needs to be available to the compiler. That means -reference to everything like System.Private.CoreLib, System.Runtime, etc, out of the .NET SDK for the version you are targeting; or the appropriate reference assemblies for the version of .NET framework you are targeting, need to be specified on the command line. |
Can you add an argument like |
No. You have to pass every assembly to the C# compiler, too. This has been required since .net core was introduced. Which the build system does. Which is why we recommend IkvmReference. |
|
You can use the tools. They are just very hard to use. Same as the csharp compiler these days. IkvmReference is the only thing mentioned in the README for this reason. |
Wait a second, does IKVM actually generate C# code instead of directly building a CIL assembly? |
No..... |
But why do you need the system assemblies then? You should only need to know whether youre targeting core or framework |
Because it needs to find types in them. |
You dont actually. Type references can be made from pure names. Actually loading system libraries is just an extra unnecessary step |
We don't know what assemblies they live in unless we look. Same situation as Roslyn. The compiler isn't hard coded to the location of classes in assemblies, since this is subject to change. |
ikvmc -target:library wxbot1.1.jar have error
IKVM.Tools.Importer (8.8.0+Branch.tags-8.8.0.Sha.0dcccd0af21487f20a29138a6a06948503cf8597)
Copyright ? 2024 Jeroen Frijters, Windward Studios, Jerome Haltom, Shad Storhaug
Core library not found. Make sure the appropriate reference assemblies for the target environment are included.
*** COMPILER ERROR ***
IKVM.Tools.Importer, Version=8.8.0.0, Culture=neutral, PublicKeyToken=13235d27fcbfff58
C:\Users\Administrator\Downloads\IKVM-8.8.0-bin-net8.0\ikvmc\net8.0\win-x64
8.0.4 64-bit
System.Exception: Exception of type 'System.Exception' was thrown.
at IKVM.Tools.Importer.StaticCompiler.Init(Boolean nonDeterministicOutput, DebugMode debug, IList`1 libpaths) in //src/IKVM.Tools.Importer/StaticCompiler.cs:line 72
at IKVM.Tools.Importer.IkvmImporterInternal.Compile(String[] args) in //src/IKVM.Tools.Importer/IkvmImporterInternal.cs:line 178
at IKVM.Tools.Importer.IkvmImporterInternal.Execute(String[] args) in /_/src/IKVM.Tools.Importer/IkvmImporterInternal.cs:line 112
The text was updated successfully, but these errors were encountered: