Instaled headers: absolute and relative at the same time

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


andrecaldas
Halfling
Posts: 54
Joined: Mon May 06, 2024 1:06 am
x 3

Instaled headers: absolute and relative at the same time

Post by andrecaldas »

Disclaimer: I am very very new to Ogre. Actually I know nothing about game development or CG. I am not supposed to be using "ogre-next". :roll:

Anyway, I have cloned ogre-next git repository. And also the ogre-next-deps. I use Debian GNU/Linux unstable. I have successfully compiled and installed them both to [mono]~/.local/[/mono]. I use meason in my project and it is very possible I have not set flags that are recommended by Ogre.

I have realized that in v1 (not next), almost everything goes to the same include directory. But in v2, there are many sub-directories. The problem is that there are many header files that us a "non-relative" relative include. For example:

Code: Select all

// In OGRE/Animation/OgreSkeletonAnimManager.h
#include "Math/Array/OgreBoneMemoryManager.h"

I believe this is wrong. Sorry if I am saying anything silly... :mrgreen:

When including [mono]OGRE/OgreSceneManager.h[/mono], I get:

Code: Select all

In file included from /home/andre/.local/include/OGRE/OgreSceneManager.h:36,
                 from ../../src/scene_graph/OgreRoot.h:28,
                 from ../../src/scene_graph/OgreRoot.cpp:23:
/home/andre/.local/include/OGRE/Animation/OgreSkeletonAnimManager.h:34:10: fatal error: Math/Array/OgreBoneMemoryManager.h: No such file or directory
   34 | #include "Math/Array/OgreBoneMemoryManager.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

For installed headers, I think the ideal approach would be having relative paths that are truly relative, like:

Code: Select all

// In OGRE/Animation/OgreSkeletonAnimManager.h
#include "../Math/Array/OgreBoneMemoryManager.h"

By the way... what a great work Ogre is!!! Congratulations to all involved parties!!! :-)

andrecaldas
Halfling
Posts: 54
Joined: Mon May 06, 2024 1:06 am
x 3

Re: Instaled headers: absolute and relative at the same time

Post by andrecaldas »

andrecaldas wrote: Mon May 06, 2024 3:52 am

I have successfully compiled and installed them both to ~/.local/. I use meason in my project and it is very possible I have not set flags that are recommended by Ogre.

I am very very sorry. I see that Ogre properly uses package-config, and I should have set PKG_CONFIG_PATH:

Code: Select all

export PKG_CONFIG_PATH=~/.local/lib/pkgconfig/

Ogre, through pkg-config, adds ~/.local/include/OGRE to the include search path. Of course, this does make it very hard to have two different versions of the library installed... but that is fine by me. :-)