Problem in running exe file on redhat linux with mono

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sanjay1974
    New Member
    • Feb 2012
    • 2

    Problem in running exe file on redhat linux with mono

    Hi,

    I am trying to run an exe file with mono on redhat linux.
    The exe file is running fine on windows xp. With mono, it is giving the following error. Kindly help.

    Thanks and Best Regards,
    Sanjay

    --> mono example.exe

    Unhandled Exception: System.TypeInit ializationExcep tion: An exception was thrown by the type initializer for Script ---> System.TypeInit ializationExcep tion: An exception was thrown by the type initializer for System.Windows. Forms.XplatUI ---> System.TypeInit ializationExcep tion: An exception was thrown by the type initializer for System.Drawing. GDIPlus ---> System.DllNotFo undException: gdiplus.dll
    at (wrapper managed-to-native) System.Drawing. GDIPlus:Gdiplus Startup (ulong&,System. Drawing.Gdiplus StartupInput&,S ystem.Drawing.G diplusStartupOu tput&)
    at System.Drawing. GDIPlus..cctor () [0x00000] in <filename unknown>:0
    --- End of inner exception stack trace ---
    at System.Drawing. Graphics.FromHd cInternal (IntPtr hdc) [0x00000] in <filename unknown>:0
    at System.Windows. Forms.XplatUIX1 1.SetDisplay (IntPtr display_handle) [0x00000] in <filename unknown>:0
    at System.Windows. Forms.XplatUIX1 1..ctor () [0x00000] in <filename unknown>:0
    at System.Windows. Forms.XplatUIX1 1.GetInstance () [0x00000] in <filename unknown>:0
    at System.Windows. Forms.XplatUI.. cctor () [0x00000] in <filename unknown>:0
    --- End of inner exception stack trace ---
    at System.Windows. Forms.Applicati on.EnableVisual Styles () [0x00000] in <filename unknown>:0
    at Script..cctor () [0x00000] in <filename unknown>:0
    --- End of inner exception stack trace ---
    at Program.Main () [0x00000] in <filename unknown>:0
    Exit 1
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    It looks like you're trying to draw a graphics window.

    The only thing I wll be able to do is ensure you've compiled it correctly - did you use the following command to compile it?

    Code:
    gmcs example.cs -pkg:dotnet
    If you have, I would recommend testing your app on Windows. If it still doesn't run on Windows, then there is another issue with mono or your code.

    Comment

    • sanjay1974
      New Member
      • Feb 2012
      • 2

      #3
      Hi,

      I did not use the command mentioned by you. I compiled it using the following command:
      ironahk --out example.exe Example.ahk

      IronAHK is the linux counterpart of autohotkey.

      The exe file thus generated is working fine on windows.
      Also, your observation is correct. The exe file tries to draw a graphics window.
      Kindly help.

      Thanks a lot for your response,

      Best Regards,
      Sanjay

      Comment

      • sicarie
        Recognized Expert Specialist
        • Nov 2006
        • 4677

        #4
        So it seems like this is working correctly
        1) you are able to write code on Linux that runs on Windows
        2) the graphics libraries needed are included to draw the window

        If you require more assistance, I would recommend asking in Mono's discussion board, but this looks like it's functioning to me - usually - if you have a 32-bit RHEL system - you will need another 32-bit Linux system (and even then some distros move system files, so it's possible, depending on the script, that you'd need a close version of RHEL) to run the code.

        If you are able to run the code on Windows, I believe this was successful.

        Comment

        Working...