Linux 3D Graphics Programming Compilation Problems

I am reading the book “Linux 3D Graphics Programming” by Norman Lin. The source code can be found on sourceforge (l3d). When trying to compile the code provide with the book I stumble ypon some compilation problems. The first big compilation is the following:

$cd l3d/source/app/lib
$make -f makeall.lnx

I got an error about g++-2.95 cannot be found, which is logical, since I have a newer version. The parameters are set in l3d/Makefile.vars. Changing any occurence of “g++-2.95″ to “g++” solved this problem.
Now I get a lot of the following kind of errors:

../../../../../../../../source/app/lib/dynamics/plugins/pyramid/pyramid.cc:36:3: error: extra qualification ‘l3d_plugin_pyramid::’ on member ‘l3d_plugin_pyramid’
make[4]: *** [pyramid.o] Error 1

Errors of this kind are solved by changing the particular line in the particular file:

 l3d_plugin_pyramid::~l3d_plugin_pyramid(void) {

becomes

 ~l3d_plugin_pyramid(void) {

Another error:

/usr/bin/ld: cannot find -lXmu
collect2: ld returned 1 exit status
make[4]: *** [pyramid.so] Error 1

Easily solved by:

$sudo apt-get install libxmu-dev libxmu6

Another error about not recognizing the option m486, forget to copy the error. Also due to newer versions, nicely solved by:

$find ./ -type f -exec sed -i 's/m486/mtune=i486/' {} \;

Then an error I ran into before:

vidinfo.cc: In function ‘int main(int, char**)’:
vidinfo.cc:41:12: error: ‘exit’ was not declared in this scope
vidinfo.cc:57:37: warning: format not a string literal and no format arguments
vidinfo.cc:188:32: error: ‘assert’ was not declared in this scope
make[1]: *** [vidinfo.o] Error 1

This is solved by putting this in the file:

#include

Next error:

vidinfo.cc:189:32: error: ‘assert’ was not declared in this scope
make[1]: *** [vidinfo.o] Error 1
make[1]: Leaving directory `/home/mrdropd/linux_3d_programming/l3d/source/utils/vidinfo'
make: *** [all] Error 2

Solved by adding to the file:

#include

Finally it compiles :-)

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.