Welcome

Troves being gleaned while surfing on the Internet mostly about computer/IT/system skills and tricks, Welcome here ...
Powered By Blogger

Disclaimer

This blog is written by the owner with real practices and tests and intended to hold all original posts except there is a clear declaration for referencing from others. Thanks for tagging with the source link or other tips for reference from here if you would like to quote partial or full text from posts in this blog.

Monday, January 3, 2011

Fix bugs for Buidling installation of G3D 7.01 in Fedora 14

Today I am porting such and such a  project which is dependent on G3D and for historical reasons this project could not work with other versions of G3D including the latest ones but versions before 8.0 since it calls some of the routines in the Libraries whose prototypes had been modified!

In conclusion, we have two bugs to fix before the G3D 7.01 library can be successfully built from the downloaded source code found at http://sourceforge.net/projects/g3d/files/g3d-cpp/7.01/G3D-7.01-src.zip/download in Fedora 14. I deem  the same problems and solutions  may as well be portable to other Linux distributions and various versions of specific distribution.

1. Edit   GLG3D.lib/include/GLG3D/Discovery2.h, add the header including definition of the macro "INT_MAX" which was referred at line 68 in this file, where the first problem you will run across in the first try of building using "./buildg3d  all" or "buildg3d --install all", or so forth the similar.

 I simply added "#include <limits.h>" right after "#include <string.h>", actually an c++ header equivalent is "climits".


(Where is "INT_MAX", "LONG_MAX", etc, defined?)
I found the container header of this macro at http://www.fredosaurus.com/notes-cpp/90summaries/summary-headers.html, you may find it useful further in the future.

2. In order to get a complete installation, test code should not be skipped either, so this fix is necessary:

in tools/viewer/MD2Viewer.cpp : 108, change
currentPose = MD2Model::Pose::Pose(MD2Model::STAND, 0);
into
currentPose = MD2Model::Pose(MD2Model::STAND, 0);

I am bit of wondering why there the class Pose 's constructor should be called in this explicit way with this originally buggy code.

3. now get back to the source directory (where ./buildg3d lies),
./buildg3d --install all"

then the library will be installed straightforwardly.

No comments: