GLC_lib & GLC_Player Forums
http://www.forum.glc-lib.net/

Include path of glc_config.h wrong after installation
http://www.forum.glc-lib.net/viewtopic.php?f=14&t=253
Page 1 of 1

Author:  Frederic [ Tue Apr 19, 2011 3:53 pm ]
Post subject:  Include path of glc_config.h wrong after installation

Hello,

there is a problem with the inclusion of glc_config.h in the header files after installing GLC lib. After issuing
Code:
qmake; make; make install
the header files in subdirectories of /usr/local/include/GLC_lib/ try to import glc_config.h by doing
Code:
#include "glc_config.h"
when it in fact has to be
Code:
#include "../glc_config.h"


At the moment I am using a combination of find/sed to fix this after installation, but it would be nice if it could be corrected upstream :-)

The script:
Code:
$ cat glc-include-fix.sh
#!/bin/sh
# this script first finds all files of the pattern glc_* in any subdirectory of /usr/local/include/GLC_lib
# and then fixes the include for glc_config.h

OS=`uname`
FIND=`which find`

if [[ "$OS" == "Linux" ]]; then
   $FIND /usr/local/include/GLC_lib -regex "/usr/local/include/GLC_lib/.*/glc_.*\.h" -print -exec sed -i\.org "s:#include\ \"glc_config.h\":#include\ \"..\/glc_config.h\":" {} \;
elif [[ "$OS" == "Darwin" ]]; then
   $FIND /usr/local/include/GLC_lib -regex "/usr/local/include/GLC_lib/[[:alnum:]]*/glc_[[:print:]]*" -print -exec sed -i \.org "s:#include\ \"glc_config.h\":#include\ \"..\/glc_config.h\":" {} \; ;
fi


Author:  laumaya [ Wed Apr 20, 2011 7:38 am ]
Post subject:  Re: Include path of glc_config.h wrong after installation

Hi,
Frederic wrote:
here is a problem with the inclusion of glc_config.h in the header files after installing GLC lib. After issuing
Code:
qmake; make; make install

the header files in subdirectories of /usr/local/include/GLC_lib/ try to import glc_config.h by doing
Code:
#include "glc_config.h"

when it in fact has to be
Code:
#include "../glc_config.h"


No, the file "glc_config.h" is copied into "/usr/local/include/GLC_lib" like other GLC_lib include files so the include :
Code:
#include "glc_config.h"

is correct.
An example :
Some header in this directory :
Code:
macbook-pro-de-laurent-ribon:~ laumaya$ cd /usr/local/include/GLC_lib/
macbook-pro-de-laurent-ribon:GLC_lib laumaya$ ls *.h
glc_boundingbox.h       glc_factory.h                 glc_openglstate.h
glc_cachemanager.h      glc_fileformatexception.h      glc_renderstatistics.h
glc_config.h        glc_global.h                  glc_state.h
glc_errorlog.h         glc_log.h                  glc_tracelog.h
glc_exception.h         glc_object.h
glc_ext.h                 glc_openglexception.h


The beginning of "glc_boundingbox.h"
Code:
//! \file glc_boundingbox.h interface for the GLC_BoundingBox class.

#ifndef GLC_BOUNDINGBOX_
#define GLC_BOUNDINGBOX_

#include "maths/glc_vector3d.h"
#include "maths/glc_utils_maths.h"
#include "maths/glc_matrix4x4.h"
#include <QtDebug>
#include "glc_config.h"

@+

Author:  Frederic [ Wed Apr 20, 2011 8:10 am ]
Post subject:  Re: Include path of glc_config.h wrong after installation

Well, that's why I wrote that the files in subdirectories of /usr/local/include/GLC_lib try to include glc_config.h.

For example /usr/local/include/GLC_lib/maths/glc_vector2d.h:
Code:
#ifndef GLC_VECTOR2D_H_
#define GLC_VECTOR2D_H_

#include <QString>
#include "glc_utils_maths.h"
#include "glc_vector2df.h"

#include "glc_config.h"
[...]


See that last line? It will not work. And there are more:
Code:
/usr/local/include/GLC_lib$ grep -R "#include \"glc_config.h\"" *
geometry/glc_geometry.h:#include "glc_config.h"
geometry/glc_primitivegroup.h:#include "glc_config.h"
[...]
io/glc_3dxmltoworld.h:#include "glc_config.h"
maths/glc_line3d.h:#include "glc_config.h"
maths/glc_vector2d.h:#include "glc_config.h"
sceneGraph/glc_3dviewinstance.h:#include "glc_config.h"


Yours,
Frederic

Author:  laumaya [ Wed Apr 20, 2011 8:43 am ]
Post subject:  Re: Include path of glc_config.h wrong after installation

Frederic wrote:
Well, that's why I wrote that the files in subdirectories of /usr/local/include/GLC_lib try to include glc_config.h.

:oops: I miss subdirectories.
I will fix this bug.
Thanks.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/