lood's picture

Using OpenTK without any IDE

Hi. I'm new at .NET, Mono and OpenTK (but it looks really promissing so I want to try it). I don't like to use IDE (like MonoDevelop or Visual Studio) - they are just big and slow. Notepad and gmcs.exe works fine for me. To use OpenTK I have to include all the files, so the "compilation line" don't look very pretty. Is there any way to make it short and clear? Like "gmcs -ref:OpenTK.dll main.cs" or something.


Comments

Comment viewing options

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

You can use make, xbuild or nant to compile your project.

  • XBuild is probably the simplest approach, since it uses the same file format as IDEs (so you can have a single file that can be built both from the terminal or from an IDE, without any extra work). It comes out of the box with Mono and .Net (called msbuild there) and can be converted to autoconf/make easily.
  • Nant uses a similar, but slightly more versatile, file format. The downside is that nant is a multi-megabyte download, which might feel a little excessive just for a terminal build.
  • Make is the old, arcane program we all love so much. Can be found on all unices and is also available on windows through msys or cygwin.

If you would like to attract external contributors to your project it would make sense to use xbuild. Of course, If you expect that you will be the only maintainer, feel free to use whichever format you are most comfortable with.

lood's picture

That will be really useful. Thanks for fast reply!

flopoloco's picture

Hello try this, it will work and it's very simple.

Step 1:
For this example we will use C:\test as our project folder. (Go ahead and create a C:\test folder in order to keep up with me)

Step 2:
Locate these 2 files from the OpenTK release, and copy them to C:\test

Game.cs
opentk-1.0-beta-2\Source\QuickStart\Game.cs

OpenTK.dll
opentk-1.0-beta-2\Binaries\OpenTK\Release\OpenTK.dll

Step 3:
Now open the command prompt and type
C:\Windows\Microsoft.NET\Framework\v3.5\csc.exe /reference:"C:\test\OpenTK.dll" /target:winexe /out:"C:\test\Game.exe" "C:\test\Game.cs"

NOTE:
Typing this command can get you information about the compiler's parameters.
C:\Windows\Microsoft.NET\Framework\v3.5\csc.exe /help

Step 4:
Run the Game.exe from the C:\test folder! Success!

P.S.1: I recommend you try SharpDevelop before you decide to drop IDEs completely. :)