Archive 17/01/2023.

Compilation error when including Terrain.h

setzer22

I get this (and only this) compilation error when including Terrain.h

In file included from (...)MyProject/Source/Components/Map/Graphics/MapGraphics.cpp:4:0:
(...)Urho3D/Source/Engine/Graphics/Terrain.h:181:15: error: ?IndexBuffer? was not declared in this scope
     SharedPtr<IndexBuffer> indexBuffer_;
               ^
(...)/Urho3D/Source/Engine/Graphics/Terrain.h:181:26: error: template argument 1 is invalid
     SharedPtr<IndexBuffer> indexBuffer_;
                          ^

[size=85]Note that I have omitted unnecesary path names. “MyProject” is my own project folder and “Urho3D” is the Urho3D main folder.[/size]

I will post my CMakeLists.txt file if requested but I don’t think it has nothing to do with it as all other headers are including just fine. The problem doesn’t seem to be either on Component.h, the file included in Terrain.h as my compiler would complain on that file as well… I suspect this might be a bug with Terrain not including all the dependencies it has because in the original engine code they were already imported beforehand. Could that be?

setzer22

I solved this by adding:

But the documentation says that to get the IndexBuffer class you should:

And the documentation for terrain doesn’t list any more includes than Terrain.h, so I don’t get why this is happening.

cadaver

Terrain.h was missing a forward declaration of IndexBuffer, it has been just added to master.

Including IndexBuffer.h is correct and platform-agnostic. Seeing OGLIndexBuffer.h there is the result of Doxygen searching through the include files to find the “actual” included file and should be ignored.

weitjong

Currently all the documentation pages in the website are generated by using Doxygen on a Linux build environment, therefore the class sources and headers are from the point of view from Linux platform. They also only show class hierarchy that uses the OpenGL backend and never the Direct3D backend, which is not entirely accurate as Urho3D library is cross-platform.

setzer22

Oh, looks like I found a bug then. Thanks for fixing it so fast!

Thank you for clarifying that, most of the includes in the documentation seem to work normally but sometimes I see strange things like that and wonder.