Error C3640 in VS22 DLL project

Copycat 0 Reputation points
2024-04-28T07:39:03.8933333+00:00

No matter what I try I keep getting a C3640 Error:

Error C3640 'DllMain::IslandPortal31::~IslandPortal31': a referenced or virtual member function of a local class must be defined

Hopeing someone can help

Header File

#ifndef __ISLANDPORTAL31_H
#define __ISLANDPORTAL31_H

#include <NPCStructure.h>

class IslandPortal31 : public NPCstructure{
public:   
	IslandPortal31();
	~IslandPortal31();
	void Create();
	void OnTalk( UNIT_FUNC_PROTOTYPE );
    void OnAttacked( UNIT_FUNC_PROTOTYPE );
    void OnInitialise( UNIT_FUNC_PROTOTYPE );
};

#endif //__ISLANDPORTAL31_H

cpp File

#include "IslandPortal31.h"

extern NPCstructure::NPC IslandPortalNPC;

/******************************************************************************/
IslandPortal31::IslandPortal31()
/******************************************************************************/
{ }

/******************************************************************************/
IslandPortal31::~IslandPortal31()
/******************************************************************************/
{ }

/******************************************************************************/
void IslandPortal31::Create( )
/******************************************************************************/
{
    npc = IslandPortalNPC;
    SET_NPC_NAME(  "[7396]A shimmering portal" );
    npc.InitialPos.X = 2991;
    npc.InitialPos.Y = 2987;
    npc.InitialPos.world = 0;
}
/******************************************************************************/
void IslandPortal31::OnAttacked( UNIT_FUNC_PROTOTYPE )
/******************************************************************************/
{
}
/******************************************************************************/
void IslandPortal31::OnInitialise( UNIT_FUNC_PROTOTYPE )
/******************************************************************************/
{
	NPCstructure::OnInitialise( UNIT_FUNC_PARAM );
	WorldPos wlPos = { 0,0,0 };
	self->SetDestination( wlPos );
	self->Do( nothing );
	self->SetCanMove( false );
}
/******************************************************************************/
void IslandPortal31::OnTalk( UNIT_FUNC_PROTOTYPE )
/******************************************************************************/
{
	InitTalk

		Begin
		""
		IF(CheckGlobalFlag(__GLOBAL_FLAG_ISLAND_MAZE_PRESET) == 1)
			IF (IsInRange(4))
				GiveFlag(__FLAG_ISLAND_MAZE_SECRET_3A, CheckFlag(__FLAG_ISLAND_MAZE_SECRET_3A) + 1)
				TELEPORT( 2998, 2994, 0)
			ELSE
				PRIVATE_SYSTEM_MESSAGE(INTL( 7349, "You must step closer to the portal to activate it."))
			ENDIF
		ELSE
			IF (IsInRange(4))
				UseC
					unsigned char bPositionWorld = unsigned char(target->ViewFlag(__FLAG_DEATH_LOCATION) & 0xFF);
					unsigned short wPositionY = unsigned short((target->ViewFlag(__FLAG_DEATH_LOCATION) & 0xFFF00) >> 8);
					unsigned short wPositionX = unsigned short((target->ViewFlag(__FLAG_DEATH_LOCATION) & 0xFFF00000) >> 20);
				IF(target->ViewFlag(__FLAG_DEATH_LOCATION) != 0)
					TELEPORT( wPositionX, wPositionY, bPositionWorld)
				ELSE
					TELEPORT(2941, 1062, 0)
				ENDIF
			ELSE
				PRIVATE_SYSTEM_MESSAGE(INTL( 7349, "You must step closer to the portal to activate it."))
			ENDIF
		ENDIF
		BREAK
		
		Default
		""
		BREAK

	EndTalk
}

Include File

#ifndef NPCSTRUCTURE_H
#define NPCSTRUCTURE_H
#include "Unit.h"
#include "random.h"
#include "MonsterStructure.h"
#include "Broadcast.h"
#include "StatModifierFlagsListing.h"
#include "BMC_MAIN.h"
#include "Objects.h"
#include "Creatures.h"
#include "ObjectListing.h"
#include "MonsterStructure.h"
#include "QuestFlagsListing.h"
#include "NPCmacroScriptLng.h"
#include "GameDefs.h"
#include "SpellListing.h"
#include "BMCTime.h"
#include "SkillListing.h"
#include "_item.h"
#include "StringUtilities.h"
/*	Color Code
~<color><text>
ex.
  "Hi, this text is red -> ~rHi hello!!~~ woohoo!"
--------------------------
~~  DEFAULT COLOR
~r	RED
~b  BLUE
~c  CYAN
~y  YELLOW
~g  GREEN
~p  PURPLE
~w  WHITE
~e  GREY
--------------------------
 */
extern Random rnd;
#define SET_NPC_NAME( __name )	npc.name = _strdup(__name);
#define SET_RANGE( lox, loy, hix, hiy ) npc.wLoXrange = lox;\
    npc.wLoYrange = loy;\
    npc.wHiXrange = hix;\
    npc.wHiYrange = hiy;
typedef struct _NPCSCHEDULE{
	BMCTIME tTriggerTime;
	int			iBehavior;		// Behavior to instill at the time
	WorldPos	wlDestination;	// Where the NPC should urge :)
	Unit		*Target;		// new target of the unit
} NPCSCHEDULE, *LPNPCSCHEDULE;
/******************************************************************************/
class /*__declspec(dllexport)*/ NPCstructure : /*public StaticFlags,*/ public BaseReferenceMessages
/******************************************************************************/
{
public:
	NPCstructure();
	virtual ~NPCstructure();
	
	// Here are implementated the default message handlings for the NPC.
	virtual void OnInitialise( UNIT_FUNC_PROTOTYPE );
	virtual void OnAttack( UNIT_FUNC_PROTOTYPE );
	virtual void OnAttacked( UNIT_FUNC_PROTOTYPE );
	virtual void OnHit( UNIT_FUNC_PROTOTYPE );
	virtual void OnServerInitialisation( UNIT_FUNC_PROTOTYPE, unsigned short wBaseReferenceID );
	virtual void OnNPCDataExchange( UNIT_FUNC_PROTOTYPE );
	virtual void OnGetUnitStructure( UNIT_FUNC_PROTOTYPE );
	virtual void OnQuerySchedule( UNIT_FUNC_PROTOTYPE );
    virtual void OnDeath( UNIT_FUNC_PROTOTYPE );
    virtual void OnAttackHit( UNIT_FUNC_PROTOTYPE );
	class /*__declspec(dllexport)*/ NPC : public MonsterStructure{
	public:
		unsigned short BaseReferenceID;
		//WorldPos InitialPos;
		unsigned long dwTextColor;		
		MonsterStructure *GetMonsterStructure( void );		
	} npc;
	TemplateList <NPCSCHEDULE> tlSchedule;
};
#endif // NPCSTRUCTURE_H
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,755 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
1,002 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.