seoushi's picture

Can't build on OS X

I'm not sure if this is mono related or mac related error but here is what I did.

Extracted the zip, went into Build via the terminal and ran "mono Build.exe mono" it runs fine until OpenTK.dll is trying to be made. Here is the relevant output

 
[csc] ** (/Library/Frameworks/Mono.framework/Versions/1.2.6/lib/mono/2.0/gmcs.exe:19216): WARNING **: The class Mono.WebBrowser.DOM.IDocument could not be loaded, used in Mono.Mozilla, Version=0.2.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756
                  [csc] ** (/Library/Frameworks/Mono.framework/Versions/1.2.6/lib/mono/2.0/gmcs.exe:19216): WARNING **: The class Mono.WebBrowser.DOM.IElement could not be loaded, used in Mono.Mozilla, Version=0.2.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756
                  [csc] ** (/Library/Frameworks/Mono.framework/Versions/1.2.6/lib/mono/2.0/gmcs.exe:19216): WARNING **: The class Mono.WebBrowser.DOM.IWindow could not be loaded, used in Mono.Mozilla, Version=0.2.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756
                  [csc] Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
                  [csc]   at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
                  [csc]   at System.Reflection.Assembly.GetExportedTypes () [0x00000] 
                  [csc]   at Mono.CSharp.TypeManager.LoadAllImportedTypes () [0x00000] 
                  [csc]   at Mono.CSharp.Driver.MainDriver (System.String[] args) [0x00000] 
                  [csc]   at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] 
 
            BUILD FAILED - 0 non-fatal error(s), 68 warning(s)
 
            /Users/seoushi/Desktop/opentk-0.9.0/Source/OpenTK/OpenTK.dll.build(10,10):
            External Program Failed: /Library/Frameworks/Mono.framework/Versions/1.2.6/lib/mono/2.0/gmcs.exe (return code was 1)

I'm curious where in the code Mono.WebBrower.DOM.IWindow is referenced (or what would be calling it). Also is there anyway for the build to be more verbose like what file is causing the exception?


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

It's difficult to say what is wrong without a debug build.

Wild stab: try using the default contructor for GameWindow (new GameWindow()), or specify a non-null DisplayMode and title for GameWindow (e.g. new GameWindow(new DisplayMode(640, 480), "Test")).

Does Examples.exe run on OSX? Try running a few samples from that, to see if they behave the same - this will help pinpoint the actual problem.

seoushi's picture

Being at work I can't really test too much but the examples have the same issue as my last post. Will work on this more when I'm at home.

the Fiddler's picture

No problem. :)

It might be useful to create a debug build on Windows and run that on OSX (instructions). Not as good as a native Mono debug build (which would give the exact line number of the crash), but it can help.

seoushi's picture

Well now I'm just confused. For a frame of reference I use 10.5 at home and 10.4 at work. Now that I'm at home I tested it by making the debug dll and enabling debug information in my program like the previous link and it works. What is even stranger is that after I got that working I put in the orignal opentk.dll and it works. Then I proceeded to rebuild my application in release mode and it works (except some windows centric path names).

So in other words my issue is solved at home. On a further note once I updated my opentk.dll.config on my home machine the examples work just fine. This is leading me to believe that it is some sort of 10.4 issue. I will find out tomorrow.

Also I am still interested in getting a native mac version going.

seoushi's picture

So at work I tested using the debug dll and app and it doesn't really give any new information.

 mono Client.exe                   
Native window driver: OpenTK.Platform.X11.X11GLNative
Display: 25923584, Screen 0, Root window: 87
Creating GameWindow with mode: 1024x768, rgba: 32 (8888), depth: 16, refresh 0Hz
    Preparing visual for DisplayMode: 1024x768, rgba: 32 (8888), depth: 16, refresh 0Hz
    Created GLContext
    Opening render window... 
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object
  at OpenTK.Platform.X11.X11GLNative.CreateWindow (OpenTK.DisplayMode mode, IGLContext& glContext) [0x00000] 
  at OpenTK.GameWindow.CreateWindow (OpenTK.DisplayMode mode, System.String title) [0x00000] 
  at OpenTK.GameWindow..ctor (OpenTK.DisplayMode mode, System.String title) [0x00000] 
  at OpenTK.GameWindow..ctor (OpenTK.DisplayMode mode) [0x00000] 
  at Client.Engine..ctor (Int32 height, Int32 width) [0x00000] 
  at Client.Program.Main
 () [0x00000]

Given that mono doesn't really have a debugger it's quite hard to trace down what exactly is null. I really think that focusing on a native version is a much better alternative then trying to fix this error.