[Kde-bindings] Re: Qyoto on Windows: AccessViolationException onstartup

Hugo Wood hx4.5 at free.fr
Sat Jan 29 20:39:20 UTC 2011


Thanks, this actually helps me a lot because I thought the error was coming 
from loading the native library,
not from the library itself. Now I can continue to search for a solution.

Hugo Wood

-----Message d'origine----- 
From: Arno Rehn
Sent: Friday, January 28, 2011 4:24 PM
To: KDE bindings for other programming languages
Subject: [Kde-bindings] Re: Qyoto on Windows: AccessViolationException 
onstartup

On Friday 28 January 2011 15:07:54 Hugo Wood wrote:
> Hello,
>
> I have been trying to compile and run Qyoto on Windows. I have manage to
> compile qyoto.dll and qt-dotnet.dll along with their smoke dependencies,
> using Visual Studio 2008 and 2010. I had to comment out some parts of the
> code dealing with QAccessibleBridgePlugin and QAccessibleBridgeFactory in
> smokeqt and some parts dealing with QDBus in qyoto, to avoid undefined
> reference linking errors. If I understood well, those parts of Qt are not
> used on Windows so they do not exist in the binaries. Am I right? I also
> had to do minor modifications to CMake files and Visual Studio project
> files generated by them. For example, the compiler was set by default to
> the MS C# 2.0 compiler, which cannot compile qt-dotnet because it uses
> extension methods (C# 3.5). Changing the CMAKE_CSharp_COMPILER did not
> work. I edited qt-dotnet.vcxproj by hand. I am saying all this so that if
> I did something I shouldn’t have someone can tell me. I had no experience
> with CMake or Qt internals before this, so I am trying stuff a bit
> blindly.
Looks good though.

> So as I said I now have qyoto.dll, qt-dotnet.dll, smokebase.dll, and a
> dozen smokeqt*.dll. I wrote a small program to test the library:
>
> static int Main(string[] args)
> {
>   new QApplication(args);
>   return QApplication.Exec();
> }
>
> The QApplication contructor ultimatly calls the native method
> CallSmokeMethod, which in turn raises an AccessViolationException. I’m
> kind of stuck. Prior messages in this mailing list about this exception
> refer to old qyoto code that has been fixed already. Could someone help
> me?
>
> Tools I am using:
> - Windows 7 x64
> - Visual Studio 2010 (also tried with 2008)
> - CMake 2.8
> - Qt 4.7.1 VS2008
> - latest source code from qyoto, smokeqt and smokegen git repositories
I don't know if VS 2010 and 2008 are compatible. Better stay with 2008.

> The trace (with some French but I am sure no one will bother :)):
>
> Exception non gérée: System.AccessViolationException: Tentative de lecture
> ou d'écriture de mémoire protégée. Cela indique souvent qu'une autre
> mémoire est endommagée. … Qyoto.SmokeInvocation.CallSmokeMethod(IntPtr
> smoke, Int32 methodId, IntPtr target, IntPtr sp, Int32 items) …
> Qyoto.SmokeInvocation.Invoke(String mungedName, String signature, Type
> returnType, Object[] args) … Qyoto.QApplication..ctor(String[] argv)
>    … ConsoleApplication1.Program.Main(String[] args) dans
> C:\...\Program.cs:ligne 12
Unfortunately it never prints a full backtrace into native code. An
AccessViolationException is a crash in native code, so you have to step in
with a normal debugger here to see what's going wrong. I once fixed all of
those bugs in Qyoto, but since then some changes have been made to Smoke and
Qyoto. You probably have to fiddle with this yourself, sorry. Porting Qyoto 
to
Windows was more of a fun-project. In theory it should be quite easy, you 
only
have to deal with some Windows-isms like these.

-- 
Arno Rehn
arno at arnorehn.de
_______________________________________________
Kde-bindings mailing list
Kde-bindings at kde.org
https://mail.kde.org/mailman/listinfo/kde-bindings 




More information about the Kde-bindings mailing list