Im using the example code from the quick start. On compile, I get an error:
error: undefined reference to 'tmx::ObjectGroup& tmx::Layer::getLayerAs<tmx::ObjectGroup>()'
Here's the code as a refresher:
tmx::Map map;
if(map.load("map1.tmx")) {
const auto& layers = map.getLayers();
for(const auto& layer : layers)
{
if(layer->getType() == tmx::Layer::Type::Object)
{
const auto& objectLayer = layer->getLayerAs<tmx::ObjectGroup>();
const auto& objects = objectLayer.getObjects();
for(const auto& object : objects)
{
//do stuff with object properties
}
}
else if(layer->getType() == tmx::Layer::Type::Tile)
{
const auto& tileLayer = layer->getLayerAs<tmx::TileLayer>();
//read out tile layer properties etc...
SDL_Log("%s", tileLayer.getName().c_str());
}
}
const auto& tilesets = map.getTilesets();
for(const auto& tileset : tilesets)
{
//read out tile set properties, load textures etc...
}
}
Im using the example code from the quick start. On compile, I get an error:
error: undefined reference to 'tmx::ObjectGroup& tmx::Layer::getLayerAs<tmx::ObjectGroup>()'Here's the code as a refresher: