[Kde-bindings] Building "assemblies" branch of assemblygen under Windows

Steven Boswell II ulatekh at yahoo.com
Thu Dec 15 02:40:13 UTC 2011


I looked at all the generated executables and DLLs with Dependency Walker; it said all of them were built for x86.  The issue is that the assemblygen executable is being built with the default value for /platform, which is "anycpu".  I hacked lines 166 and 268 of cmake/modules/CMakeCSharpInformation.cmake to add "/platform:x86" and got past this.


Now assemblygen runs, the Q_PROPERTY strings aren't garbage, and the code generated looks OK...but the C# compiler dies with what appears to be bogus errors:

[...]bxq-dqos.19.cs(31,39) : error CS1031: Type expected
[...]\bxq-dqos.19.cs(31,59) : error CS1002: ; expected
[...]\bxq-dqos.19.cs(32,20) : error CS1519: Invalid token ')' in class, struct, or interface member declaration
[...]\bxq-dqos.19.cs(33,16) : error CS1519: Invalid token '(' in class, struct, or interface member declaration
[...]\bxq-dqos.19.cs(36,2) : error CS1022: Type or namespace definition, or end-of-file expected


Unfortunately, the temporary file mentioned in the error messages is gone before I can look at it.  I assume it's compiling assemblygen-build/bin/qyoto-qtcore.cs, but the affected lines don't appear to have any problem.  Here's a snippet of the code in the area:

     16     [SmokeClass("QAbstractAnimation")]^M
     17     public abstract partial class QAbstractAnimation : QObject, System.IDisposable {^M
     18         ^M
     19         static SmokeInvocation staticInterceptor = new SmokeInvocation(typeof(QAbstractAnimation), null);^M
     20         ^M
     21         protected QAbstractAnimation(System.Type dummy) : ^M
     22                 base((System.Type) null) {^M
     23         }^M
     24         ^M
     25         [SmokeMethod("QAbstractAnimation()")]^M
     26         public QAbstractAnimation() : ^M
     27                 this((System.Type) null) {^M
     28             object[] smokeArgs = new object[0];^M
     29             this.CreateProxy();^M
     30             this.interceptor.Invoke("QAbstractAnimation", "QAbstractAnimation()", typeof(void), false, smokeArgs);^M
     31         }^M
     32         ^M
     33         [SmokeMethod("QAbstractAnimation(QObject*)")]^M
     34         public QAbstractAnimation(QObject arg1) : ^M
     35                 this((System.Type) null) {^M
     36             object[] smokeArgs = new object[] {^M
     37                     typeof(QObject),^M
     38                     arg1};^M
     39             this.CreateProxy();^M
     40             this.interceptor.Invoke("QAbstractAnimation#", "QAbstractAnimation(QObject*)", typeof(void), false, smokeArgs);
     41         }^M

Has anyone else run into this, or know what the problem is?

Steven Boswell



________________________________
 From: Dimitar Dobrev <dpldobrev at yahoo.com>
To: Steven Boswell II <ulatekh at yahoo.com>; KDE bindings for other programming languages <kde-bindings at kde.org> 
Sent: Monday, December 12, 2011 1:13 AM
Subject: Re: [Kde-bindings] Building "assemblies" branch of assemblygen under Windows
 

I guess you are using a 64-bit Windows, like me. The solution is to create a VS/MonoDevelop project, include all files of assemblygen but without the plugins, build for x86 and place the result in your CMake directory for "binaries",



________________________________
 From: Steven Boswell II <ulatekh at yahoo.com>
To: KDE bindings <kde-bindings at kde.org> 
Sent: Monday, December 12, 2011 2:30 AM
Subject: [Kde-bindings] Building "assemblies" branch of assemblygen under Windows
 

[...] assemblygen.exe crashes upon startup:

Unhandled Exception: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) 
   at MainClass.InitSmoke(String module) 
   at MainClass.Main(String[] args)[...]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20111214/a79edfb0/attachment.html>


More information about the Kde-bindings mailing list