Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apparently unused imports causing linking issues when removed #9766

Open
Tracked by #20979
FrancescoBorzi opened this issue Dec 18, 2021 · 2 comments
Open
Tracked by #20979

Apparently unused imports causing linking issues when removed #9766

FrancescoBorzi opened this issue Dec 18, 2021 · 2 comments
Labels
CORE Related to the core

Comments

@FrancescoBorzi
Copy link
Contributor

FrancescoBorzi commented Dec 18, 2021

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
Copy link
Member

This file contains functions inplementation

@FrancescoBorzi FrancescoBorzi added the CORE Related to the core label Aug 27, 2023
@FrancescoBorzi
Copy link
Contributor Author

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 to Acore::UnitLastSearcherAcore::NearestAttackableUnitInObjectRangeCheck::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 function void Map::Visit<Acore::UnitLastSearcherAcore::NearestAttackableUnitInObjectRangeCheck, TypeMapContainer<TypeList<GameObject, TypeList<Creature, TypeList<DynamicObject, TypeList<Corpse, TypeNull> > > > > >(Cell const&, TypeContainerVisitor<Acore::UnitLastSearcherAcore::NearestAttackableUnitInObjectRangeCheck, 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 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::UnitLastSearcherAcore::MostHPMissingInRange, TypeList<GameObject, TypeList<Player, TypeList<Creature, TypeList<Corpse, TypeList<DynamicObject, TypeNull> > > > > >(unsigned int, unsigned int, TypeContainerVisitor<Acore::UnitLastSearcherAcore::MostHPMissingInRange, TypeMapContainer<TypeList<GameObject, TypeList<Player, TypeList<Creature, TypeList<Corpse, TypeList<DynamicObject, TypeNull> > > > > > >&)':

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CORE Related to the core
Projects
None yet
Development

No branches or pull requests

2 participants