I have 4 files world.cpp, world.hpp, Helpers/tools.cpp, Helpers/tools.hpp.
wrold.cpp and tools.cpp include their respective headers and world.hpp includes tools.hpp
world.hpp/cpp use structures defined in tools.hpp/cpp
on my CMake file I have added
target_sources(voxel-world PUBLIC ${PROJECT_SOURCE_DIR}/Helpers/tools.cpp)
and
target_sources(voxel-world PUBLIC ${PROJECT_SOURCE_DIR}/World.cpp)
So, to my understading, the generated make file should attempt to link everything properly.
However when I attempt to compile my program I get the error message:
CMakeFiles/voxel-world.dir/source/World.cpp.o: In function `Chunk_Holder::Chunk_Holder()':
World.cpp:(.text+0x112a): undefined reference to `cirArray<cirArray<cirArray<Chunk*> > >::cirArray()'
CMakeFiles/voxel-world.dir/source/World.cpp.o: In function `Chunk_Holder::Chunk_Holder(int, int, int, World*)':
World.cpp:(.text+0x117c): undefined reference to `cirArray<cirArray<cirArray<Chunk*> > >::cirArray()'
World.cpp:(.text+0x11a2): undefined reference to `cirArray<cirArray<cirArray<Chunk*> > >::cirArray(unsigned int)'
World.cpp:(.text+0x11ee): undefined reference to `cirArray<cirArray<Chunk*> >::cirArray(unsigned int)'
...
...
I am not sure why the linker is failing to find these declarations, since the include statements are on each file. What have I missed?