[2.1] Build error when including OgreHlmsPbs.h

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


libolt
Greenskin
Posts: 126
Joined: Wed Jan 19, 2005 4:48 am
x 9

[2.1] Build error when including OgreHlmsPbs.h

Post by libolt »

So I started porting my code from 2.0 to 2.1 last night and began implementing Hlms based on the example code provided by xrgo. However, I ran into some issues compiling against 2.1 and ended up updating my CMakeLists.txt to include.

I added ${OGRE_HlmsPbs_INCLUDE_DIRS} ${OGRE_HlmsUnlit_INCLUDE_DIRS} to my INCLUDE_DIRECTORIES which fixed an error of OgreHlmsPbs.h not being found. Now however, I get the following:

Code: Select all

[  1%] Building CXX object CMakeFiles/ubc.dir/src/engine/gameengine.cpp.o
In file included from /home/libolt/Projects/ubc-ogre-2.1/include/engine/renderengine.h:48,
                 from /home/libolt/Projects/ubc-ogre-2.1/src/engine/gameengine.cpp:27:
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbs.h:32:10: fatal error: OgreHlmsBufferManager.h: No such file or directory
   32 | #include "OgreHlmsBufferManager.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
This is on OpenSUSE Tumbleweed/GCC but I get the same error on Windows 10/MSVC 2019. It appears that OgreHlmsBufferManager.h sits in include/OGRE/Hlms/Common but I'm not sure what is the best way to incorporate this into my CMake configuration.

Thank you
rujialiu
Goblin
Posts: 296
Joined: Mon May 09, 2016 8:21 am
x 35

Re: [2.1] Build error when including OgreHlmsPbs.h

Post by rujialiu »

libolt wrote: Mon Oct 21, 2019 9:01 pm This is on OpenSUSE Tumbleweed/GCC but I get the same error on Windows 10/MSVC 2019. It appears that OgreHlmsBufferManager.h sits in include/OGRE/Hlms/Common but I'm not sure what is the best way to incorporate this into my CMake configuration.
I totally forgot about Ogre 2.1 but for Ogre 2.2 we had similar issues before but are later fixed (at least you can say "improved"):
viewtopic.php?f=25&t=94588#p543081

I don't know whether you're directly adding Ogre source files into your project, or build an "SDK" version of Ogre, then use the SDK version in your project. They're somewhat different...
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5435
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1342

Re: [2.1] Build error when including OgreHlmsPbs.h

Post by dark_sylinc »

libolt wrote: Mon Oct 21, 2019 9:01 pm but I'm not sure what is the best way to incorporate this into my CMake configuration.
Since this is C++, there is no "best" way to incorporate this :lol:

(Unfortunately) There's two types of header structures:
  1. Out of source (i.e. directly including Ogre's repository)
  2. SDK structure (i.e. including that's in build/SDK after running CMake install target)
They're both very similar but slightly different. Ultmately all C++ cares is that the files under Components/Hlms/Common/include are the include paths and thus the files can be found.

In Samples/2.0/Tutorials/EmptyProject we have a series of CMake scripts that assume Ogre is setup using an out of source build.
See Using Ogre in your App
for details on using EmptyProject.
These scripts will add the required locations:

Code: Select all

include_directories( "${OGRE_BINARIES}/include" )
include_directories( "${OGRE_SOURCE}/Components/Hlms/Common/include" )
include_directories( "${OGRE_SOURCE}/Components/Hlms/Unlit/include" )
include_directories( "${OGRE_SOURCE}/Components/Hlms/Pbs/include" )
as well as storing library names into OGRE_LIBRARIES variable.

You are not forced to use EmptyProject exactly, but you can base your code on it.
DERGO, Colibri and Living Room for example use it and they expect Ogre repo (or a symlink) to be located in Dependencies/Ogre; and CMake's build to be stored in Dependencies/Ogre/build/Debug (and Release).

If you're having trouble, the build scripts will generate the repository structure these scripts based on EmptyProject wants.

Cheers
libolt
Greenskin
Posts: 126
Joined: Wed Jan 19, 2005 4:48 am
x 9

Re: [2.1] Build error when including OgreHlmsPbs.h

Post by libolt »

dark_sylinc,

Thanks. I use the SDK structure and have traditionally used the FindOgre.cmake included in the sdk/CMake folder to locate Ogre headers and libraries. My CMakeLists.txt dates back almost 15 years and I believe the earliest version I used was CMake 2.4. I'm sure it can use some cleanup but that's low on the priority list right now.

I will take a look at the links/examples you provided and figure out what works best for me. I'm used to building/installing libraries in the traditional Linux sense having used it for over 20 years now.

Thanks again for the help.
libolt
Greenskin
Posts: 126
Joined: Wed Jan 19, 2005 4:48 am
x 9

Re: [2.1] Build error when including OgreHlmsPbs.h

Post by libolt »

Okay so I fixed that problem now I get the following build error in OgreHlmsPbsDatablock.h:

Code: Select all

libolt@tbird:~/Projects/ubc-ogre-2.1-build> make
[  1%] Building CXX object CMakeFiles/ubc.dir/src/engine/gameengine.cpp.o
In file included from /usr/include/X11/Xlib.h:44,
                 from /usr/include/SDL2/SDL_syswm.h:66,
                 from /home/libolt/Projects/ubc-ogre-2.1/include/engine/inputengine.h:28,
                 from /home/libolt/Projects/ubc-ogre-2.1/src/engine/gameengine.cpp:24:
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:193:13: error: expected identifier before numeric constant
  193 |             None,
      |             ^~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:193:13: error: expected ‘}’ before numeric constant
In file included from /home/libolt/Projects/ubc-ogre-2.1/include/engine/renderengine.h:51,
                 from /home/libolt/Projects/ubc-ogre-2.1/src/engine/gameengine.cpp:27:
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:191:9: note: to match this ‘{’
  191 |         {
      |         ^
In file included from /usr/include/X11/Xlib.h:44,
                 from /usr/include/SDL2/SDL_syswm.h:66,
                 from /home/libolt/Projects/ubc-ogre-2.1/include/engine/inputengine.h:28,
                 from /home/libolt/Projects/ubc-ogre-2.1/src/engine/gameengine.cpp:24:
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:193:13: error: expected unqualified-id before numeric constant
  193 |             None,
      |             ^~~~
In file included from /home/libolt/Projects/ubc-ogre-2.1/include/engine/renderengine.h:51,
                 from /home/libolt/Projects/ubc-ogre-2.1/src/engine/gameengine.cpp:27:
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:221:5: error: expected unqualified-id before ‘protected’
  221 |     protected:
      |     ^~~~~~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:232:9: error: ‘TransparencyModes’ does not name a type
  232 |         TransparencyModes mTransparencyMode;
      |         ^~~~~~~~~~~~~~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:262:9: error: ‘virtual’ outside class declaration
  262 |         virtual void cloneImpl( HlmsDatablock *datablock ) const;
      |         ^~~~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:262:60: error: non-member function ‘void Ogre::cloneImpl(Ogre::HlmsDatablock*)’ cannot have cv-qualifier
  262 |         virtual void cloneImpl( HlmsDatablock *datablock ) const;
      |                                                            ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:265:9: error: ‘virtual’ outside class declaration
  265 |         virtual void uploadToConstBuffer( char *dstPtr );
      |         ^~~~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:266:9: error: ‘virtual’ outside class declaration
  266 |         virtual void notifyOptimizationStrategyChanged(void);
      |         ^~~~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:274:5: error: expected unqualified-id before ‘public’
  274 |     public:
      |     ^~~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:378:35: error: declaration of ‘~Ogre::HlmsPbsDatablock’ as non-member
  378 |         virtual ~HlmsPbsDatablock();
      |                                   ^
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:383:48: error: non-member function ‘Ogre::ColourValue Ogre::getBackgroundDiffuse()’ cannot have cv-qualifier
  383 |         ColourValue getBackgroundDiffuse(void) const;
      |                                                ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:387:34: error: non-member function ‘Ogre::Vector3 Ogre::getDiffuse()’ cannot have cv-qualifier
  387 |         Vector3 getDiffuse(void) const;
      |                                  ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:391:35: error: non-member function ‘Ogre::Vector3 Ogre::getSpecular()’ cannot have cv-qualifier
  391 |         Vector3 getSpecular(void) const;
      |                                   ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:395:34: error: non-member function ‘float Ogre::getRoughness()’ cannot have cv-qualifier
  395 |         float getRoughness(void) const;
      |                                  ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:402:35: error: non-member function ‘Ogre::Vector3 Ogre::getEmissive()’ cannot have cv-qualifier
  402 |         Vector3 getEmissive(void) const;
      |                                   ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:404:40: error: non-member function ‘bool Ogre::hasEmissiveConstant()’ cannot have cv-qualifier
  404 |         bool hasEmissiveConstant(void) const;
      |                                        ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:406:33: error: non-member function ‘bool Ogre::_hasEmissive()’ cannot have cv-qualifier
  406 |         bool _hasEmissive(void) const;
      |                                 ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:427:37: error: non-member function ‘Ogre::Workflows Ogre::getWorkflow()’ cannot have cv-qualifier
  427 |         Workflows getWorkflow(void) const;
      |                                     ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:437:34: error: non-member function ‘float Ogre::getMetalness()’ cannot have cv-qualifier
  437 |         float getMetalness(void) const;
      |                                  ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:470:34: error: non-member function ‘Ogre::Vector3 Ogre::getFresnel()’ cannot have cv-qualifier
  470 |         Vector3 getFresnel(void) const;
      |                                  ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:473:39: error: non-member function ‘bool Ogre::hasSeparateFresnel()’ cannot have cv-qualifier
  473 |         bool hasSeparateFresnel(void) const;
      |                                       ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:502:58: error: non-member function ‘Ogre::TexturePtr Ogre::getTexture(Ogre::PbsTextureTypes)’ cannot have cv-qualifier
  502 |         TexturePtr getTexture( PbsTextureTypes texType ) const;
      |                                                          ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:503:49: error: non-member function ‘Ogre::TexturePtr Ogre::getTexture(size_t)’ cannot have cv-qualifier
  503 |         TexturePtr getTexture( size_t texType ) const;
      |                                                 ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:507:58: error: non-member function ‘Ogre::uint16 Ogre::_getTextureIdx(Ogre::PbsTextureTypes)’ cannot have cv-qualifier
  507 |         uint16 _getTextureIdx( PbsTextureTypes texType ) const          { return mTexIndices[texType]; }
      |                                                          ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:519:76: error: non-member function ‘const Ogre::HlmsSamplerblock* Ogre::getSamplerblock(Ogre::PbsTextureTypes)’ cannot have cv-qualifier
  519 |         const HlmsSamplerblock* getSamplerblock( PbsTextureTypes texType ) const;
      |                                                                            ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:533:64: error: non-member function ‘Ogre::uint8 Ogre::getTextureUvSource(Ogre::PbsTextureTypes)’ cannot have cv-qualifier
  533 |         uint8 getTextureUvSource( PbsTextureTypes sourceType ) const;
      |                                                                ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:547:67: error: non-member function ‘Ogre::PbsBlendModes Ogre::getDetailMapBlendMode(Ogre::uint8)’ cannot have cv-qualifier
  547 |         PbsBlendModes getDetailMapBlendMode( uint8 detailMapIdx ) const;
      |                                                                   ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:567:64: error: non-member function ‘Ogre::Real Ogre::getDetailNormalWeight(Ogre::uint8)’ cannot have cv-qualifier
  567 |         Real getDetailNormalWeight( uint8 detailNormalMapIdx ) const;
      |                                                                ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:573:39: error: non-member function ‘Ogre::Real Ogre::getNormalMapWeight()’ cannot have cv-qualifier
  573 |         Real getNormalMapWeight(void) const;
      |                                       ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:590:52: error: non-member function ‘Ogre::Real Ogre::getDetailMapWeight(Ogre::uint8)’ cannot have cv-qualifier
  590 |         Real getDetailMapWeight( uint8 detailMap ) const;
      |                                                    ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:604:60: error: non-member function ‘Ogre::Vector4 Ogre::getDetailMapOffsetScale(Ogre::uint8)’ cannot have cv-qualifier
  604 |         Vector4 getDetailMapOffsetScale( uint8 detailMap ) const;
      |                                                            ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:608:61: error: non-member function ‘Ogre::uint8 Ogre::getBakedTextureIdx(Ogre::PbsTextureTypes)’ cannot have cv-qualifier
  608 |         uint8 getBakedTextureIdx( PbsTextureTypes texType ) const;
      |                                                             ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:626:40: error: non-member function ‘bool Ogre::getTwoSidedLighting()’ cannot have cv-qualifier
  626 |         bool getTwoSidedLighting(void) const;
      |                                        ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:628:9: error: ‘virtual’ outside class declaration
  628 |         virtual bool hasCustomShadowMacroblock(void) const;
      |         ^~~~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:628:54: error: non-member function ‘bool Ogre::hasCustomShadowMacroblock()’ cannot have cv-qualifier
  628 |         virtual bool hasCustomShadowMacroblock(void) const;
      |                                                      ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:638:9: error: ‘virtual’ outside class declaration
  638 |         virtual void setAlphaTestThreshold( float threshold );
      |         ^~~~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:655:51: error: ‘TransparencyModes’ has not been declared
  655 |         void setTransparency( float transparency, TransparencyModes mode = Transparent,
      |                                                   ^~~~~~~~~~~~~~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:655:76: error: ‘Transparent’ was not declared in this scope; did you mean ‘transparency’?
  655 |         void setTransparency( float transparency, TransparencyModes mode = Transparent,
      |                                                                            ^~~~~~~~~~~
      |                                                                            transparency
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:658:37: error: non-member function ‘float Ogre::getTransparency()’ cannot have cv-qualifier
  658 |         float getTransparency(void) const                           { return mTransparencyValue; }
      |                                     ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:659:9: error: ‘TransparencyModes’ does not name a type; did you mean ‘mTransparencyValue’?
  659 |         TransparencyModes getTransparencyMode(void) const           { return mTransparencyMode; }
      |         ^~~~~~~~~~~~~~~~~
      |         mTransparencyValue
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:660:44: error: non-member function ‘bool Ogre::getUseAlphaFromTextures()’ cannot have cv-qualifier
  660 |         bool getUseAlphaFromTextures(void) const                    { return mUseAlphaFromTextures; }
      |                                            ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:672:38: error: non-member function ‘bool Ogre::getReceiveShadows()’ cannot have cv-qualifier
  672 |         bool getReceiveShadows(void) const;
      |                                      ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:679:52: error: non-member function ‘Ogre::Vector4 Ogre::getUserValue(Ogre::uint8)’ cannot have cv-qualifier
  679 |         Vector4 getUserValue( uint8 userValueIdx ) const;
      |                                                    ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:730:45: error: non-member function ‘Ogre::CubemapProbe* Ogre::getCubemapProbe()’ cannot have cv-qualifier
  730 |         CubemapProbe* getCubemapProbe(void) const;
      |                                             ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:735:30: error: non-member function ‘Ogre::uint32 Ogre::getBrdf()’ cannot have cv-qualifier
  735 |         uint32 getBrdf(void) const;
      |                              ^~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:764:9: error: ‘virtual’ outside class declaration
  764 |         virtual void saveTextures( const String &folderPath, set<String>::type &savedTextures,
      |         ^~~~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:768:9: error: ‘virtual’ outside class declaration
  768 |         virtual void calculateHash();
      |         ^~~~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:770:29: error: uninitialized const ‘Ogre::MaterialSizeInGpu’ [-fpermissive]
  770 |         static const size_t MaterialSizeInGpu;
      |                             ^~~~~~~~~~~~~~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:771:29: error: uninitialized const ‘Ogre::MaterialSizeInGpuAligned’ [-fpermissive]
  771 |         static const size_t MaterialSizeInGpuAligned;
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~
/home/libolt/usr/ogre-2.1-sdk/include/OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h:777:1: error: expected declaration before ‘}’ token
  777 | }
      | ^
make[2]: *** [CMakeFiles/ubc.dir/build.make:76: CMakeFiles/ubc.dir/src/engine/gameengine.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:78: CMakeFiles/ubc.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5435
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1342

Re: [2.1] Build error when including OgreHlmsPbs.h

Post by dark_sylinc »

Xlib.h has the bad habit of defining "None" with a macro.

Either move your header inclusion so that OgreHlmsPbsDatablock.h is included before X11 headers, or use '#undef None' before including Ogre headers
libolt
Greenskin
Posts: 126
Joined: Wed Jan 19, 2005 4:48 am
x 9

Re: [2.1] Build error when including OgreHlmsPbs.h

Post by libolt »

Thanks,

I just did #undef None since I don't directly include Xlib.h or any other X11 headers. That fixed the problem, however I did get an error about

Code: Select all

No rule to make target '/usr/lib64/libIlmImf.so'
Which I fixed by symlinking /usr/lib64/libIlmImf-2_4.so.24.0.0 to /usr/lib64/libIlmImf.so. Not the ideal solution if/when libIlmImf-2_4 is updated but will work for now.

Now I need to get Hlms working in my game.

Thanks again.
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5435
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1342

Re: [2.1] Build error when including OgreHlmsPbs.h

Post by dark_sylinc »

I don't recognize libIlmImf. Google says it's an OpenCV library.

We don't use that directly. Perhaps one of our Dependencies does. It appears it's used by OpenEXR, which is used by FreeImage.
andrecaldas
Halfling
Posts: 54
Joined: Mon May 06, 2024 1:06 am
x 3

Re: [2.1] Build error when including OgreHlmsPbs.h

Post by andrecaldas »

dark_sylinc wrote: Tue Oct 22, 2019 3:22 am

These scripts will add the required locations:

Code: Select all

include_directories( "${OGRE_BINARIES}/include" )
include_directories( "${OGRE_SOURCE}/Components/Hlms/Common/include" )
include_directories( "${OGRE_SOURCE}/Components/Hlms/Unlit/include" )
include_directories( "${OGRE_SOURCE}/Components/Hlms/Pbs/include" )

as well as storing library names into OGRE_LIBRARIES variable.

I am doing the SDK flavour... and I am using Meason instead of CMake. Meason uses the info exported by pkgconfig. In my "meason.build" script, I do

Code: Select all

deps = [
  dependency('OGRE'),
  dependency('OGRE-Hlms'),
  dependency('OGRE-Overlay'),
  dependency('OGRE-MeshLodGenerator'),
]

I need all those dependencies because there are four pkgconfig files for ogre: OGRE.pc, OGRE-Hlms.pc, etc. Of course, I could use only the last three. But then it would be semantically incorrect IMO (although I do not know what Hlms actually is).

This setup uses pkgconfig. But see the pkgconfig output...

Code: Select all

$ pkgconf --cflags OGRE
-I/home/andre/.local/include -I/home/andre/.local/include/OGRE 
$ pkgconf --cflags OGRE-Hlms 
-I/home/andre/.local/include/OGRE/Hlms -I/home/andre/.local/include -I/home/andre/.local/include/OGRE 
$ pkgconf --cflags OGRE-Overlay 
-I/home/andre/.local/include/OGRE/Overlay -I/home/andre/.local/include -I/home/andre/.local/include/OGRE 
$ pkgconf --cflags OGRE-MeshLodGenerator 
-I/home/andre/.local/include/OGRE/MeshLodGenerator -I/home/andre/.local/include -I/home/andre/.local/include/OGRE 

IMO, it would be better if "pkgconf --cflags OGRE-Hlms" also returned Hlms/Common, Hlms/Pbs, Hlms/Unlit.

And it would be perfect if I did not have to use all those dependencies. Maybe "pkgconf --cflags OGRE" should return all paths. Or... if not... maybe some sort of "OGRE-all". The same for libraries.