• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] [Mangos->TC] small issue when merging

Status
Not open for further replies.

callmephil

Respected Member
Hey guys so i'm actually merging the script of lilcarl about Talent template system.
all is ok, but i'm stuck with iterator i'm not sure at all about the error but anyway...

Here is the original script :
https://github.com/Lillecarl/mangos-tbc/commit/289f9797fc749cf65629a7284c026fdada167b65

Here is the merged one :
https://gist.github.com/callmephil/ba6467fe1e8f2830809f

the final error is
Code:
Error	746	error LNK2019: unresolved external symbol "public: __thiscall Custom::Custom(void)" (??0Custom@@QAE@XZ) referenced in function "protected: __thiscall ACE_Singleton<class Custom,class ACE_Null_Mutex>::ACE_Singleton<class Custom,class ACE_Null_Mutex>(void)" (??0?$ACE_Singleton@VCustom@@VACE_Null_Mutex@@@@IAE@XZ)	H:\WoW-Server Repack\TrinityCore Build\src\server\worldserver\game.lib(Custom.obj)	worldserver

Maybe should i find a new name for custom ?

I'm using VS 13
 

Rochet2

Moderator / Eluna Dev
You have Custom(); and no definition.
LilleCarl uses Custom() { };
So he defines it when he declares it.
Use the same or remove the declaration.

The singleton attempts to use the default constructor but its not defined for you.
 

callmephil

Respected Member
it's sims like the { }; does not match anymore for trinity

unexpected token(s) preceding '{'; skipping apparent function body (H:\WoW-Server\TrinityCore Sources\src\server\game\Custom\Custom.cpp)

-- Edit --

hmm it's maybe should i remove also
Code:
Custom::~Custom()
{
	for (TalentContainer::const_iterator itr = m_TalentContainer.begin(); itr != m_TalentContainer.end(); ++itr)
		delete *itr;
}
also ?

because the code is calling him again anyway.
 
Last edited:

Tommy

Founder
it's sims like the { }; does not match anymore for trinity

unexpected token(s) preceding '{'; skipping apparent function body (H:\WoW-Server\TrinityCore Sources\src\server\game\Custom\Custom.cpp)

-- Edit --

hmm it's maybe should i remove also
Code:
Custom::~Custom()
{
	for (TalentContainer::const_iterator itr = m_TalentContainer.begin(); itr != m_TalentContainer.end(); ++itr)
		delete *itr;
}
also ?

because the code is calling him again anyway.

You should never remove code in ~FUNCTION() because it can cause memory leaks if specific things aren't cleaned. What you said about the brackets made no sense. Of course they match. If they didn't C++ would be worthless. Brackets such as '{ };' are for classes, structs, etc.

I don't see any issues as so why it is throwing the error, but I may can solve it. These classes aren't being used in Custom.h:

Code:
class Custom_UnitExtension {
    public:
        Custom_UnitExtension(Unit* unit);
        ~Custom_UnitExtension();
 
    private:
        Unit* _unit;
};
 
class Custom_PlayerExtension : public Custom_UnitExtension {
    public:
        Custom_PlayerExtension(Player* player);
       ~Custom_PlayerExtension();
 
            // Talent
           // void LearnTalentTemplate(uint8 spec);
 
    private:
        Player* _player;
};

Remove them. 'Custom();' doesn't have a body in Custom.cpp, so let's give it one. Put the following code above 'Custom::~Custom()' in Custom.cpp:

Code:
Custom::Custom() { }
 

callmephil

Respected Member
Code:
class Custom_UnitExtension {
    public:
        Custom_UnitExtension(Unit* unit);
        ~Custom_UnitExtension();
 
    private:
        Unit* _unit;
};
 
class Custom_PlayerExtension : public Custom_UnitExtension {
    public:
        Custom_PlayerExtension(Player* player);
       ~Custom_PlayerExtension();
 
            // Talent
           // void LearnTalentTemplate(uint8 spec);
 
    private:
        Player* _player;
};
This code is only for my own no worries.
And i've solved the issue by using a second public: after the class custom in .h the npc works fine.
 
Status
Not open for further replies.
Top