
[Solved] Using OpenTK at Linux?
Posted Tuesday, 30 June, 2009 - 19:27 by CheatCat inI tried the run my game at Linux, but I only get this error:
"The type or namespace name `OpenTK' could not be found. Are you missing a using directive or an assembly reference?(CS0246)]"
And I have the OpenTK dll in the bin\Debug directory. Should I make a new dll in Linux? (I use the one I compiled in Windows)
A have another question also: How I do a Linux executable file?


Comments
Re: Using OpenTK at Linux?
This is a compilation error, not a runtime error. Are you using MonoDevelop? Have you added OpenTK.dll to your project references? Have you added OpenTK.dll.config to your project and enabled the "copy to output directory" option?
To answer your question, OpenTK works out of the box on Linux, you don't have to recompile or anything.
Edit: 'gmcs' is the C# compiler for Mono. It creates executables by default.
Install MonoDevelop to get a full-featured IDE. MonoDevelop uses Visual Studio projects, so you can move from Windows <-> Linux painlessly.
On Ubuntu:
Type this line on a terminal to get a full-feature environment for .Net development.
Re: Using OpenTK at Linux?
Yes, I use MonoDevelop and I do what you say. I try to run the QuickStart program but it ends quickly after running it. Then I test Debug mode and get a black window. There is a yellow pile that point at VSync = VSyncMode.On; in the function:
But I see no errors... I removed the VSync line and the yellow pile point at the } instead. It something wrong with public Game() : base(800, 600, GraphicsMode.Default, "OpenTK Quick Start Sample") I think..
Re: Using OpenTK at Linux?
Need more information:
Re: Using OpenTK at Linux?
The version of OpenTK is.. 0.9.7, I think. My OS is Kubuntu 9.04 x86.
The output:
Re: Using OpenTK at Linux?
It seems that OpenTK.dll.config is missing. This file should be in the same directory as OpenTK.dll, because otherwise OpenTK won't work on Linux/Mac OS X.
Re: Using OpenTK at Linux?
Okey, I get it! :D But how I start my program stand-alone? If I double-click at the exe file, it opens with Wine and don't run at all (but it run in Mono at debugmode)!
Re: Using OpenTK at Linux?
Right click and select 'open with mono'. If there's no such option, use 'open with other application' and type 'mono' as the application.
You could also create an executable script that simply calls 'mono App.exe' (where App.exe is the name of your application).
Re: Using OpenTK at Linux?
But then you must have mono on every computer with Linux you that to play the game on?
Re: Using OpenTK at Linux?
Obviously, yes. Developing for the .Net framework means you are dependent on .Net on Windows and Mono on Linux / Mac OS X.
Re: Using OpenTK at Linux?
Oh, thank you! :D