azerothcore / azerothcore-wotlk

Complete Open Source and Modular solution for MMO
http://www.azerothcore.org
GNU Affero General Public License v3.0
6.58k stars 2.63k forks source link

Apparently unused imports causing linking issues when removed #9766

Open FrancescoBorzi opened 2 years ago

FrancescoBorzi commented 2 years ago

There are some imports that are not required for compilation, but somehow removing them causes linking issues. Something is wrong with our includes and we should fix it.

// TODO: this import is not necessary for compilation and marked as unused by the IDE
//  however, for some reasons removing it would cause a damn linking issue
//  there is probably some underlying problem with imports which should properly addressed
#include "GridNotifiersImpl.h"
Winfidonarleyan commented 2 years ago

This file contains functions inplementation

FrancescoBorzi commented 1 year ago

Example errors:

[ 99%] Linking CXX executable unit_tests /usr/bin/ld: ../server/game/libgame.a(TotemAI.cpp.o): in function void NGrid<8u, Player, TypeList<GameObject, TypeList<Player, TypeList<Creature, TypeList<Corpse, TypeList<DynamicObject, TypeNull> > > > >, TypeList<GameObject, TypeList<Creature, TypeList<DynamicObject, TypeList<Corpse, TypeNull> > > > >::VisitGrid<Acore::UnitLastSearcher<Acore::NearestAttackableUnitInObjectRangeCheck>, TypeList<GameObject, TypeList<Player, TypeList<Creature, TypeList<Corpse, TypeList<DynamicObject, TypeNull> > > > > >(unsigned int, unsigned int, TypeContainerVisitor<Acore::UnitLastSearcher<Acore::NearestAttackableUnitInObjectRangeCheck>, TypeMapContainer<TypeList<GameObject, TypeList<Player, TypeList<Creature, TypeList<Corpse, TypeList<DynamicObject, TypeNull> > > > > > >&)': TotemAI.cpp:(.text._ZN5NGridILj8E6Player8TypeListI10GameObjectS1_IS0_S1_I8CreatureS1_I6CorpseS1_I13DynamicObject8TypeNullEEEEES1_IS2_S1_IS3_S1_IS5_S1_IS4_S6_EEEEE9VisitGridIN5Acore16UnitLastSearcherINSI_39NearestAttackableUnitInObjectRangeCheckEEESB_EEvjjR20TypeContainerVisitorIT_16TypeMapContainerIT0_EE[_ZN5NGridILj8E6Player8TypeListI10GameObjectS1_IS0_S1_I8CreatureS1_I6CorpseS1_I13DynamicObject8TypeNullEEEEES1_IS2_S1_IS3_S1_IS5_S1_IS4_S6_EEEEE9VisitGridIN5Acore16UnitLastSearcherINSI_39NearestAttackableUnitInObjectRangeCheckEEESB_EEvjjR20TypeContainerVisitorIT_16TypeMapContainerIT0_EE]+0x3f): undefined reference toAcore::UnitLastSearcher::Visit(GridRefMgr&)' /usr/bin/ld: TotemAI.cpp:(.text._ZN5NGridILj8E6Player8TypeListI10GameObjectS1_IS0_S1_I8CreatureS1_I6CorpseS1_I13DynamicObject8TypeNullEEEEES1_IS2_S1_IS3_S1_IS5_S1_IS4_S6_EEEEE9VisitGridIN5Acore16UnitLastSearcherINSI_39NearestAttackableUnitInObjectRangeCheckEEESB_EEvjjR20TypeContainerVisitorIT_16TypeMapContainerIT0_EE[_ZN5NGridILj8E6Player8TypeListI10GameObjectS1_IS0_S1_I8CreatureS1_I6CorpseS1_I13DynamicObject8TypeNullEEEEES1_IS2_S1_IS3_S1_IS5_S1_IS4_S6_EEEEE9VisitGridIN5Acore16UnitLastSearcherINSI_39NearestAttackableUnitInObjectRangeCheckEEESB_EEvjjR20TypeContainerVisitorIT_16TypeMapContainerIT0_EE]+0x5e): undefined reference to Acore::UnitLastSearcher<Acore::NearestAttackableUnitInObjectRangeCheck>::Visit(GridRefMgr<Creature>&)' /usr/bin/ld: ../server/game/libgame.a(TotemAI.cpp.o): in functionvoid Map::Visit<Acore::UnitLastSearcher, TypeMapContainer<TypeList<GameObject, TypeList<Creature, TypeList<DynamicObject, TypeList<Corpse, TypeNull> > > > > >(Cell const&, TypeContainerVisitor<Acore::UnitLastSearcher, TypeMapContainer<TypeList<GameObject, TypeList<Creature, TypeList<DynamicObject, TypeList<Corpse, TypeNull> > > > > >&)': TotemAI.cpp:(.text._ZN3Map5VisitIN5Acore16UnitLastSearcherINS1_39NearestAttackableUnitInObjectRangeCheckEEE16TypeMapContainerI8TypeListI10GameObjectS6_I8CreatureS6_I13DynamicObjectS6_I6Corpse8TypeNullEEEEEEEvRK4CellR20TypeContainerVisitorIT_T0_E[_ZN3Map5VisitIN5Acore16UnitLastSearcherINS1_39NearestAttackableUnitInObjectRangeCheckEEE16TypeMapContainerI8TypeListI10GameObjectS6_I8CreatureS6_I13DynamicObjectS6_I6Corpse8TypeNullEEEEEEEvRK4CellR20TypeContainerVisitorIT_T0_E]+0xa7): undefined reference to Acore::UnitLastSearcher<Acore::NearestAttackableUnitInObjectRangeCheck>::Visit(GridRefMgr<Creature>&)' /usr/bin/ld: ../server/game/libgame.a(ScriptedCreature.cpp.o): in functionvoid NGrid<8u, Player, TypeList<GameObject, TypeList<Player, TypeList<Creature, TypeList<Corpse, TypeList<DynamicObject, TypeNull> > > > >, TypeList<GameObject, TypeList<Creature, TypeList<DynamicObject, TypeList<Corpse, TypeNull> > > > >::VisitGrid<Acore::UnitLastSearcher, TypeList<GameObject, TypeList<Player, TypeList<Creature, TypeList<Corpse, TypeList<DynamicObject, TypeNull> > > > > >(unsigned int, unsigned int, TypeContainerVisitor<Acore::UnitLastSearcher, TypeMapContainer<TypeList<GameObject, TypeList<Player, TypeList<Creature, TypeList<Corpse, TypeList<DynamicObject, TypeNull> > > > > > >&)':