How to add a APIclass variable in Class

hello,I want to ask you a question.
I want to add a APIClass variable in my Class.But compilation failed.
here’s my “.h” file.


“FVoronoiDiagram VoronoiDiagram;” is class of Voronoi API .

but is failed.
here’s my livecoding

however, put it as a global variable in the “.cpp” file, there will be no error.


i need help. :sob:

Are you including that Voronoi header in your TerrainGenerator header?

In order to have a non-pointer, non-reference member variable you need the full type definition. Hence the include is required. It works in your cpp because that includes the Voronoi header.

1 Like

haha,You’re so good :smiling_face_with_three_hearts:. I made it.thank you very much.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.