Would like to test qt4dotnet but : Error when trying to run the example, in VS2010, os=xp-sp3

133 views
Skip to first unread message

Epic

unread,
Jul 29, 2010, 9:22:05 AM7/29/10
to qt4dotnet
Hi all,

got this error when running the example in VS2010, any ideas ?
Epic


The type initializer for 'com.trolltech.qt.gui.QApplication' threw an
exception.


System.TypeInitializationException was unhandled
Message=The type initializer for 'com.trolltech.qt.gui.QApplication'
threw an exception.
Source=qtjambi-4.6.3
TypeName=com.trolltech.qt.gui.QApplication
StackTrace:
at com.trolltech.qt.gui.QApplication.initialize(String[] args)
at TestQT1.Program.Main(String[] args) in D:\qt4dotnetlib
\TestQT1\TestQT1\Program.cs:line 84
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly,
String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile,
Evidence assemblySecurity, String[] args)
at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object
state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.TypeInitializationException
Message=The type initializer for
'com.trolltech.qt.core.QCoreApplication' threw an exception.
Source=qtjambi-4.6.3
TypeName=com.trolltech.qt.core.QCoreApplication
StackTrace:
at com.trolltech.qt.core.QCoreApplication.__<clinit>()
at com.trolltech.qt.gui.QApplication..cctor()
InnerException: System.TypeInitializationException
Message=The type initializer for
'com.trolltech.qt.core.QObject' threw an exception.
Source=qtjambi-4.6.3
TypeName=com.trolltech.qt.core.QObject
StackTrace:
at com.trolltech.qt.core.QObject.__<clinit>()
at com.trolltech.qt.core.QCoreApplication..cctor()
InnerException: System.TypeInitializationException
Message=The type initializer for
'com.trolltech.qt.QtJambiObject' threw an exception.
Source=qtjambi-4.6.3
TypeName=com.trolltech.qt.QtJambiObject
StackTrace:
at com.trolltech.qt.QtJambiObject.__<clinit>()
at com.trolltech.qt.core.QObject..cctor()
InnerException: System.TypeInitializationException
Message=The type initializer for
'com.trolltech.qt.QtJambi_LibraryInitializer' threw an exception.
Source=qtjambi-4.6.3

TypeName=com.trolltech.qt.QtJambi_LibraryInitializer
StackTrace:
at
com.trolltech.qt.QtJambi_LibraryInitializer.init()
at com.trolltech.qt.QtJambiObject..cctor()
InnerException:
System.TypeInitializationException
Message=The type initializer for
'com.trolltech.qt.Utilities' threw an exception.
Source=qtjambi-4.6.3
TypeName=com.trolltech.qt.Utilities
StackTrace:
at
com.trolltech.qt.Utilities.loadSystemLibraries()
at
com.trolltech.qt.QtJambi_LibraryInitializer..cctor()
InnerException:
System.IO.FileNotFoundException
Message=Could not load file or
assembly 'IKVM.Runtime, Version=0.42.0.6, Culture=neutral,
PublicKeyToken=13235d27fcbfff58' or one of its dependencies. The
system cannot find the file specified.
Source=IKVM.OpenJDK.Core
FileName=IKVM.Runtime,
Version=0.42.0.6, Culture=neutral, PublicKeyToken=13235d27fcbfff58
FusionLog==== Pre-bind state
information ===
LOG: User = DELLPC\DellC521
LOG: DisplayName = IKVM.Runtime, Version=0.42.0.6, Culture=neutral,
PublicKeyToken=13235d27fcbfff58
(Fully-specified)
LOG: Appbase = file:///D:/qt4dotnetlib/TestQT1/TestQT1/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : IKVM.OpenJDK.Core, Version=0.42.0.6,
Culture=neutral, PublicKeyToken=13235d27fcbfff58.
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET
\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: IKVM.Runtime, Version=0.42.0.6,
Culture=neutral, PublicKeyToken=13235d27fcbfff58
LOG: Attempting download of new URL file:///D:/qt4dotnetlib/TestQT1/TestQT1/bin/Debug/IKVM.Runtime.DLL.
LOG: Attempting download of new URL
file:///D:/qt4dotnetlib/TestQT1/TestQT1/bin/Debug/IKVM.Runtime/IKVM.Runtime.DLL.
LOG: Attempting download of new URL file:///D:/qt4dotnetlib/TestQT1/TestQT1/bin/Debug/IKVM.Runtime.EXE.
LOG: Attempting download of new URL
file:///D:/qt4dotnetlib/TestQT1/TestQT1/bin/Debug/IKVM.Runtime/IKVM.Runtime.EXE.

StackTrace:
at
java.util.Hashtable..ctor(Int32 initialCapacity, Single loadFactor)
at java.util.Hashtable..ctor()
at
java.util.Properties..ctor(Properties defaults)
at java.util.Properties..ctor()
at
com.trolltech.qt.Utilities..cctor()
InnerException:

Stefan Monov

unread,
Aug 19, 2010, 3:45:10 PM8/19/10
to qt4dotnet
Hi.

You must copy IKVM.OpenJDK.Core.dll next to your exe, and also add it
as a reference to your project. Same for the rest of the dlls as
described on the qt4dotnet homepage.

For more info see this email of mine (the devs don't seem to be
around, so they haven't updated/clarified the homepage):
http://groups.google.com/group/qt4dotnet/msg/91c4f1e355a5c5bd

peter bax

unread,
Aug 24, 2010, 10:10:47 AM8/24/10
to qt4d...@googlegroups.com
Hi Stefan,

i keep getting same errors .

I did put ALL the Dll/s in the exe folder.

Could you describe to me , which steps you took to get output ?

NOTE :  the compiles are ok, without errors , so only at runtime the dlls are not foud,

Pete


--
You received this message because you are subscribed to the Google Groups "qt4dotnet" group.
To post to this group, send email to qt4d...@googlegroups.com.
To unsubscribe from this group, send email to qt4dotnet+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/qt4dotnet?hl=en.


peter bax

unread,
Aug 24, 2010, 9:27:57 AM8/24/10
to qt4d...@googlegroups.com
Hi , 

the error i am getting now is :

"Can't load library: D:\\TestQT1\\TestQT1\\bin\\Debug\\QtCore4.dll"

Pete

On Tue, Aug 24, 2010 at 9:51 AM, peter bax <pwm...@gmail.com> wrote:
Hi ,

thanks, will try asap,

Pete

On Thu, Aug 19, 2010 at 9:45 PM, Stefan Monov <logi...@gmail.com> wrote:

peter bax

unread,
Aug 24, 2010, 3:51:21 AM8/24/10
to qt4d...@googlegroups.com
Hi ,

thanks, will try asap,

Pete
On Thu, Aug 19, 2010 at 9:45 PM, Stefan Monov <logi...@gmail.com> wrote:

David Canar

unread,
Aug 24, 2010, 10:41:57 AM8/24/10
to qt4d...@googlegroups.com
Hi, make sure you are using the DLLs that correspond to your ARCH (32
bits vs 64 bits) if you have a 64 bit machine and if you use the 32bit
DLLs make sure you compile your application as an "x86" binary and not
as an "Any CPU" binary (in the Properties->Build->Platform Target
section), the later will try to find 64 bit version dlls in a 64 bit
version machine.

Thanks,

David.

peter bax

unread,
Aug 24, 2010, 10:51:08 AM8/24/10
to qt4d...@googlegroups.com
Hi david,

was already set to x86 , but still the same.

here is a screenshot 
Pete
screenshot.JPG
screenshot2.JPG
screenshot3.JPG

peter bax

unread,
Aug 24, 2010, 10:53:00 AM8/24/10
to qt4d...@googlegroups.com
Hi ,

hope you can point me to right direction, have spent few days now, tried also to copy all dlls to exe directory, but so far no result,

Pete

On Tue, Aug 24, 2010 at 4:41 PM, David Canar <david...@gmail.com> wrote:

David Canar

unread,
Aug 24, 2010, 11:02:23 AM8/24/10
to qt4d...@googlegroups.com
You should have all the Qt jambi DLLs:

com_trolltech_qt_core.dll
com_trolltech_qt_gui.dll, etc.(the ones that have this pattern:
com_trolltech_qt_*.dll)

Make sure you copied those DLLs from the Qt Jambi 4.6.3 folder that
you should have downloaded from here:

http://sourceforge.net/projects/qtjambi/files/

I think those files are under the LIB folder.

Also you have to make sure you have the qtjambi.dll found in the same
place (so you will have a qtjambi.dll and a qtjambi-4.6.3.dll, the
later comes from the qt4dotnet project). You also have to copy the Qt
shared libraries (i.e. QtCore4.dll, QtGui4.dll etc) and finally make
sure you have the correct ikvm-native.dll there too. (the one that is
found in the qtjambi-4.6.3.zip file in the qt4dotnet project.

To test first put all these DLLs next to your executable. And let me
know if that works.

I hope that helps.

Thanks,

David.

Frank T. Bergmann

unread,
Aug 24, 2010, 11:06:34 AM8/24/10
to qt4d...@googlegroups.com

Hello Pete,

 

one thing you can do is to install dependencywalker (32 bit) from: http://www.dependencywalker.com/ and run it on the native dll's in the folder. it will let you know which dependency cannot be fulfulled.

 

best
Frank

peter bax

unread,
Aug 24, 2010, 11:16:24 AM8/24/10
to qt4d...@googlegroups.com
Hi David,

have almost all but : 

dowloaded again the qt4dotnet ( 64mb) , byt there is no qtjambi-4.6.3.zip in this ,

"the one that is
found in the qtjambi-4.6.3.zip file in the qt4dotnet projec"

could you point me to the right file ?

( also where are the Shared files from qt located ? ??) 



thanks, Pete

David Canar

unread,
Aug 24, 2010, 11:20:32 AM8/24/10
to qt4d...@googlegroups.com
This is the qtjambi-4.6.3.zip :
http://code.google.com/p/qt4dotnet/downloads/detail?name=qtjambi-4.6.3.zip

The Shared libs for Qt are located under: qtjambi-4.6.3\bin folder of
the QtJambi library, The QtJambi libs are located under
qtjambi-4.6.3\lib

Thanks,

David.

peter bax

unread,
Aug 24, 2010, 11:22:41 AM8/24/10
to qt4d...@googlegroups.com
Hi david,

think i got all of it now, see screenshot,

but still same runtime error
Pete
screenshot4.JPG

David Canar

unread,
Aug 24, 2010, 11:27:50 AM8/24/10
to qt4d...@googlegroups.com
You also need to reference these assemblies from your project:

IKVM.OpenJDK.Core.dll
IKVM.Runtime.dll
IKVM.Runtime.JNI.dll

Referencing those will copy a bunch other IKVM.*.dll files in your application.

These are found in the qtjambi-4.6.3.zip that I mentioned before. I
think those are the last ones you are missing

Thanks,

David.

peter bax

unread,
Aug 24, 2010, 11:29:11 AM8/24/10
to qt4d...@googlegroups.com
Hello Frank,

here ist he outhput from the dep. walker,

thanks, Pete
screenshot5.JPG

peter bax

unread,
Aug 24, 2010, 11:54:37 AM8/24/10
to qt4d...@googlegroups.com
Hi david,

these are referenced now,

have all dlls in the project now. 

but runtime error is : cannot find qtcore4.dll
see below:

thanks, Pete


System.TypeInitializationException was unhandled
  Message=The type initializer for 'com.trolltech.qt.gui.QApplication' threw an exception.
  Source=qtjambi-4.6.3
  TypeName=com.trolltech.qt.gui.QApplication
  StackTrace:
       at com.trolltech.qt.gui.QApplication.initialize(String[] args)
       at TestQT1.Program.Main(String[] args) in D:\TestQT1\TestQT1\Program.cs:line 85
                      InnerException: java.lang.RuntimeException
                           Message=Loading library failed, progress so far:
No 'qtjambi-deployment.xml' found in classpath, loading libraries via 'java.library.path'
Loading library: 'QtCore4.dll'...
 - using 'java.library.path'

                           Source=qtjambi-4.6.3
                           StackTrace:
                                at com.trolltech.qt.internal.NativeLibraryManager.loadNativeLibrary(String )
                                at com.trolltech.qt.internal.NativeLibraryManager.loadQtLibrary(String library, String version)
                                at com.trolltech.qt.Utilities.loadQtLibrary(String library, String version)
                                at com.trolltech.qt.Utilities.loadQtLibrary(String library)
                                at com.trolltech.qt.QtJambi_LibraryInitializer..cctor()
                           InnerException: java.lang.UnsatisfiedLinkError
                                Message=Can't load library: D:\TestQT1\TestQT1\bin\Debug\QtCore4.dll
                                Source=IKVM.OpenJDK.Core
                                StackTrace:
                                     at java.lang.ClassLoader.loadLibrary(Class , String , Boolean )
                                     at java.lang.Runtime.load0(Class , String )
                                     at java.lang.Runtime.load(String filename)
                                     at com.trolltech.qt.internal.NativeLibraryManager.loadLibrary_helper(String )
                                     at com.trolltech.qt.internal.NativeLibraryManager.loadNativeLibrary(String )
                                InnerException: 

Frank T. Bergmann

unread,
Aug 24, 2010, 11:53:58 AM8/24/10
to qt4d...@googlegroups.com

Hello Pete ...

 

that diealog shows that there is no error with the ikvm-native.dll ... you want to continue that for the remaining files. Especially the key files like qtjambi.dll

peter bax

unread,
Aug 24, 2010, 12:05:50 PM8/24/10
to qt4d...@googlegroups.com
Hello Frank,

ok ! 

apparently the msvcm80.dll's ( but all 3 of them ?)  were also necessary , when the dep walker tested on qtjambi.dll ,

the demo app is running now ! 

many thanks  !!!
Reply all
Reply to author
Forward
0 new messages