You are here

ValaWinPKG Tutorial : using Vala with FreeGLUT

Objectives : use ValaWinPKG to compile the Vala FreeGLUT sample under Windows.

Vala documentation provides a FreeGLUT sample displaying a 3D teapot, which you will be able
to move using the keyboard.

  (here is the standalone source code of this sample for commodity)

Under Linux Debian/Ubuntu, you can compile it easily.

Under Microsoft© Windows, although there is a MinGW version of FreeGLUT, not only do
you have to install it by copying all files manually, but even if it's well done, you still get these error messages :

 valac --pkg gl --pkg glu --pkg glut glut-sample.vala
 error: Package `gl' not found in specified Vala API directories or GObject-Introspection GIR directories
 error: Package `glu' not found in specified Vala API directories or GObject-Introspection GIR directories
 error: Package `glut' not found in specified Vala API directories or GObject-Introspection GIR directories
 Compilation failed: 3 error(s), 0 warning(s)

We will solve this problem by using ValaWinPKG.

1) Install ValaWinPKG

Download and install ValaWinPKG 0.9c (8,85 Mo).

2) Install Vala (if needed)

Download and install Vala 0.12.0 pour Windows (12,5 Mo).

3) Install the FreeGLUT package with ValaWinPKG

Click on "Start" -> "Programs" -> "ValaWinPKG 0.9c".
ValaWinPKG should start and its packets list fill up.

If it's not the case, maybe your Vala compiler isn't well installed, or your Internet connection isn't up ;
otherwise, ask here.

Check the "FreeGLUT" line and click on "Update".


A download window briefly appears...

It's done.

Let's test our compile command again : valac --pkg gl --pkg glu --pkg glut glut-sample.vala

It works ! If we click on the final "glut-sample.exe" executable now...

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.