[Ikvm-developers] Link Error and System.ArgumentOutOfRangeException
Brought to you by:
jfrijters
|
From: Enrico M. <enr...@gm...> - 2009-04-27 06:21:10
|
Hi Jeroen,
I have a question regarding the 0.40 relase candidate 1. I try to
compile slf4j-api and slf4j-jdk14 in version 1.5.0 using the multi
target support. When I run
mono ../../ikvm/bin/ikvmc.exe -target:library
{ ../../java/lib/slf4j-api-1.5.0.jar }
{ ../../java/lib/slf4j-jdk14-1.5.0.jar }
I get:
Note IKVMC0002: output file is "slf4j-api-1.5.0.dll"
Note IKVMC0002: output file is "slf4j-jdk14-1.5.0.dll"
Link Error: Field "java.util.logging.Level.FINEST" is of type
"java.util.logging.Level, IKVM.OpenJDK.Util, Version=0.40.0.1,
Culture=neutral, PublicKeyToken=13235d27fcbfff58" instead of type
"java.util.logging.Level, IKVM.OpenJDK.Util, Version=0.40.0.1,
Culture=neutral, PublicKeyToken=13235d27fcbfff58" as expected by
"org.slf4j.impl.JDK14LoggerAdapter"
What exactly does the Link Error mean / indicate?
When I add the -r:../../ikvm/bin/IKVM.OpenJDK.Util.dll reference, I get
mono ../../ikvm/bin/ikvmc.exe -r:../../ikvm/bin/IKVM.OpenJDK.Util.dll
-target:library { ../../java/lib/slf4j-api-1.5.0.jar }
{ ../../java/lib/slf4j-jdk14-1.5.0.jar }
System.ArgumentOutOfRangeException: Argument is out of range.
Parameter name: imageFileMachine
at IKVM.Reflection.Emit.Writer.ModuleWriter.WriteModule
(System.String directory, System.Reflection.StrongNameKeyPair keyPair,
IKVM.Reflection.Emit.ModuleBuilder moduleBuilder, PEFileKinds fileKind,
PortableExecutableKinds portableExecutableKind, ImageFileMachine
imageFileMachine, IKVM.Reflection.Emit.Writer.ByteBuffer
versionInfoData, Int32 entryPointToken) [0x00000]
at IKVM.Reflection.Emit.AssemblyBuilder.Save (System.String
assemblyFileName, PortableExecutableKinds portableExecutableKind,
ImageFileMachine imageFileMachine) [0x00000]
at IKVM.Internal.CompilerClassLoader.Save () [0x00000]
at IKVM.Internal.CompilerClassLoader.Compile
(System.Collections.Generic.List`1 optionsList) [0x00000]
at IkvmcCompiler.Main (System.String[] args) [0x00000]
When I add the -r:../../ikvm/bin/IKVM.OpenJDK.Core.dll reference before
the Util.dll reference, I again get:
mono ../../ikvm/bin/ikvmc.exe -r:../../ikvm/bin/IKVM.OpenJDK.Core.dll
-r:../../ikvm/bin/IKVM.OpenJDK.Util.dll -target:library
{ ../../java/lib/slf4j-api-1.5.0.jar }
{ ../../java/lib/slf4j-jdk14-1.5.0.jar }
Note IKVMC0002: output file is "slf4j-api-1.5.0.dll"
Note IKVMC0002: output file is "slf4j-jdk14-1.5.0.dll"
Link Error: Field "java.util.logging.Level.FINEST" is of type
"java.util.logging.Level, IKVM.OpenJDK.Util, Version=0.40.0.1,
Culture=neutral, PublicKeyToken=13235d27fcbfff58" instead of type
"java.util.logging.Level, IKVM.OpenJDK.Util, Version=0.40.0.1,
Culture=neutral, PublicKeyToken=13235d27fcbfff58" as expected by
"org.slf4j.impl.JDK14LoggerAdapter"
But when I add the Core.dll reference after the Util.dll reference, I
get the ArgumentOutOfRangeException from above:
mono ../../ikvm/bin/ikvmc.exe -r:../../ikvm/bin/IKVM.OpenJDK.Util.dll
-r:../../ikvm/bin/IKVM.OpenJDK.Core.dll -target:library
{ ../../java/lib/slf4j-api-1.5.0.jar }
{ ../../java/lib/slf4j-jdk14-1.5.0.jar }
Note IKVMC0002: output file is "slf4j-api-1.5.0.dll"
Note IKVMC0002: output file is "slf4j-jdk14-1.5.0.dll"
System.ArgumentOutOfRangeException: Argument is out of range.
Parameter name: imageFileMachine
at IKVM.Reflection.Emit.Writer.ModuleWriter.WriteModule
(System.String directory, System.Reflection.StrongNameKeyPair keyPair,
IKVM.Reflection.Emit.ModuleBuilder moduleBuilder, PEFileKinds fileKind,
PortableExecutableKinds portableExecutableKind, ImageFileMachine
imageFileMachine, IKVM.Reflection.Emit.Writer.ByteBuffer
versionInfoData, Int32 entryPointToken) [0x00000]
at IKVM.Reflection.Emit.AssemblyBuilder.Save (System.String
assemblyFileName, PortableExecutableKinds portableExecutableKind,
ImageFileMachine imageFileMachine) [0x00000]
at IKVM.Internal.CompilerClassLoader.Save () [0x00000]
at IKVM.Internal.CompilerClassLoader.Compile
(System.Collections.Generic.List`1 optionsList) [0x00000]
at IkvmcCompiler.Main (System.String[] args) [0x00000]
How come that the order of references has an impact on the outcome? I
hope this are not, again, Mono bugs :-)
I can send you the respective jar files if requested.
Thanks in advance,
Enrico M.
|