Book Review: How to Implement Design Patterns in PHP
Using PHP pspell Spell Check Functions with a Custom Dictionary
A Simple ISAPI Filter for Authentication on IIS
Using Multi-Byte Character Sets in PHP (Unicode, UTF-8, etc)
Enforce Coding Standards with PHP_CodeSniffer and Eclipse IDE on Ubuntu Linux
Nice n' Easy JQuery Image Rotator

G3D on Ubuntu Linux

Saturday, 19 December 09, 8:42 pm
G3D is a cross-platform OpenGL library in C++. I haven't used it in a couple of years, when I first experimented with 3D C++ programming. The current version is 8 beta 2.

To install on Linux, you'll need to compile the G3D code from source. In my case, on Ubuntu 9.10, I had to install the following dependencies first:
sudo apt-get install libsdl1.2-dev xorg-dev libglu1-mesa-dev libzip-dev libavutil-dev
Then compilation is a question of running the following command from wherever you extracted the G3D files to:
sudo ./buildg3d --install /usr/local update
The IDE I intend to use is Code::Blocks, available in the Ubuntu repos. In order to get a G3D program to compile and link in Ubuntu, you need to add the following libraries in the Linker settings tab of the Project > Build options.. dialog:

zip
SDLmain
SDL
GLG3D
G3D
GL
GLU
avutil
avformat
avcodec
avfilter
avdevice
postproc
swscale
png
jpeg

Note that the ordering of this list matters. There are very tiny up and down arrows on the right hand side of the list which let you reorder it if necessary. In particular, GLG3D needs to come before G3D otherwise you'll get errors like "undefined reference to G3D::GLight::directional" and "undefined reference to G3D::MeshAlg::computeFaceNormals".

Please enter your comment in the box below. Comments will be moderated before going live. Thanks for your feedback!

Cancel Post

/xkcd/ Proterozoic Rocks