View unanswered posts | View active topics It is currently Fri Mar 22, 2019 11:00 pm



Reply to topic  [ 4 posts ] 
 Include path of glc_config.h wrong after installation 
Author Message

Joined: Tue Apr 19, 2011 3:35 pm
Posts: 5
Location: Bremen, Germany
 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



Tue Apr 19, 2011 3:53 pm
Profile WWW
Site Admin

Joined: Sun Jan 03, 2010 4:27 pm
Posts: 390
Post 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"

@+


Wed Apr 20, 2011 7:38 am
Profile

Joined: Tue Apr 19, 2011 3:35 pm
Posts: 5
Location: Bremen, Germany
Post 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


Wed Apr 20, 2011 8:10 am
Profile WWW
Site Admin

Joined: Sun Jan 03, 2010 4:27 pm
Posts: 390
Post 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.


Wed Apr 20, 2011 8:43 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.