Visual C ++ - 错误LNK2019 [英] Visual C++ - Error LNK2019

查看:97
本文介绍了Visual C ++ - 错误LNK2019的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我正在开发新的GTA插件:San Andreas多人游戏修改,但是当我尝试编译pluigin时,我收到了这个错误。 />


Hi guys,

I'm developing new Plugin for GTA:San Andreas Multiplayer modification but when i try compile pluigin i'm getting this error.

Error	1	error LNK2019: unresolved external symbol "public: int __cdecl Janus::cagir(struct PAWN::Native const *,...)" (?cagir@Janus@@QAAHPBUNative@PAWN@@ZZ) referenced in function "long __cdecl JanusOyuncuData(struct tagAMX *,long *)" (?JanusOyuncuData@@YAJPAUtagAMX@@PAJ@Z)	C:\Users\sbs\documents\visual studio 2012\Projects\Janus\Janus\janusDef.obj	Janus

Error	2	error LNK1120: 1 unresolved externals	C:\Users\sbs\documents\visual studio 2012\Projects\Janus\Debug\Janus.dll	1	1	Janus







这个代码:



Janus.h




This the codes:

Janus.h

#include <../SDK/plugincommon.h>
#include <../SDK/amx/amx.h>

#include <bitset>
#include <list>
#include <map>
#include <stdarg.h>

namespace PAWN
{
	struct Native
	{
		const char * name;
		const char * data;
	};

	static const char * const names[] =
	{
		"SendClientMessage",
		"SendClientMessageToAll",
		"SendDeathMessage",
		"GameTextForAll",
		"GameTextForPlayer",
		"GetTickCount",
		"GetMaxPlayers",
		"SetGameModeText",
		"SetTeamCount",
		"AddPlayerClass",
		"AddPlayerClassEx",
		"AddStaticVehicle",
		"AddStaticVehicleEx",
		"AddStaticPickup",
		"ShowNameTags",
		"ShowPlayerMarkers",
		"GameModeExit",
		"SetWorldTime",
		"GetWeaponName",
		"EnableTirePopping",
		"AllowInteriorWeapons",
		"SetWeather",
		"SetGravity",
		"AllowAdminTeleport",
		"SetDeathDropAmount",
		"CreateExplosion",
		"EnableZoneNames",
		"IsPlayerAdmin",
		"Kick",
		"Ban",
		"SendRconCommand",
		"ShowPlayerDialog",

		//a_players.inc
		"SetSpawnInfo",
		"SpawnPlayer",
		"SetPlayerPos",
		"GetPlayerPos",
		"SetPlayerFacingAngle",
		"GetPlayerFacingAngle",
		"SetPlayerInterior",
		"GetPlayerInterior",
		"SetPlayerHealth",
		"GetPlayerHealth",
		"SetPlayerArmour",
		"GetPlayerArmour",
		"SetPlayerAmmo",
		"GetPlayerAmmo",
		"SetPlayerTeam",
		"GetPlayerTeam",
		"SetPlayerScore",
		"GetPlayerScore",
		"SetPlayerColor",
		"GetPlayerColor",
		"SetPlayerSkin",
		"GivePlayerWeapon",
		"ResetPlayerWeapons",
		"GetPlayerWeaponData",
		"GivePlayerMoney",
		"ResetPlayerMoney",
		"SetPlayerName",
		"GetPlayerMoney",
		"GetPlayerState",
		"GetPlayerIp",
		"GetPlayerPing",
		"GetPlayerWeapon",
		"GetPlayerKeys",
		"GetPlayerName",
		"PutPlayerInVehicle",
		"GetPlayerVehicleID",
		"RemovePlayerFromVehicle",
		"TogglePlayerControllable",
		"PlayerPlaySound",
		"SetPlayerCheckpoint",
		"DisablePlayerCheckpoint",
		"SetPlayerRaceCheckpoint",
		"DisablePlayerRaceCheckpoint",
		"SetPlayerWorldBounds",
		"SetPlayerMarkerForPlayer",
		"ShowPlayerNameTagForPlayer",
		"SetPlayerMapIcon",
		"RemovePlayerMapIcon",
		"SetPlayerCameraPos",
		"SetPlayerCameraLookAt",
		"SetCameraBehindPlayer",
		"AllowPlayerTeleport",
		"IsPlayerConnected",
		"IsPlayerInVehicle",
		"IsPlayerInAnyVehicle",
		"IsPlayerInCheckpoint",
		"IsPlayerInRaceCheckpoint",
		"SetPlayerTime",
		"TogglePlayerClock",
		"SetPlayerWeather",
		"GetPlayerTime",
		"SetPlayerVirtualWorld",
		"GetPlayerVirtualWorld",

		//a_vehicle.inc
		"CreateVehicle",
		"DestroyVehicle",
		"GetVehiclePos",
		"SetVehiclePos",
		"GetVehicleZAngle",
		"SetVehicleZAngle",
		"SetVehicleParamsForPlayer",
		"SetVehicleToRespawn",
		"LinkVehicleToInterior",
		"AddVehicleComponent",
		"ChangeVehicleColor",
		"ChangeVehiclePaintjob",
		"SetVehicleHealth",
		"GetVehicleHealth",
		"AttachTrailerToVehicle",
		"DetachTrailerFromVehicle",
		"IsTrailerAttachedToVehicle",
		"SetVehicleNumberPlate",
		"GetVehicleModel",
		"SetVehicleVirtualWorld",
		"GetVehicleVirtualWorld",
		"ApplyAnimation",

		//a_objects.inc
		"CreateObject",
		"SetObjectPos",
		"GetObjectPos",
		"SetObjectRot",
		"GetObjectRot",
		"IsValidObject",
		"DestroyObject",
		"MoveObject",
		"StopObject",
		"CreatePlayerObject",
		"SetPlayerObjectPos",
		"GetPlayerObjectPos",
		"GetPlayerObjectRot",
		"SetPlayerObjectRot",
		"IsValidPlayerObject",
		"DestroyPlayerObject",
		"MovePlayerObject",
		"StopPlayerObject",

		//Menu's
		"CreateMenu",
		"DestroyMenu",
		"AddMenuItem",
		"SetMenuColumnHeader",
		"ShowMenuForPlayer",
		"HideMenuForPlayer",
		"IsValidMenu",
		"DisableMenu",
		"DisableMenuRow",

		//Textdraw
		"TextDrawCreate",
		"TextDrawDestroy",
		"TextDrawLetterSize",
		"TextDrawTextSize",
		"TextDrawAlignment",
		"TextDrawColor",
		"TextDrawUseBox",
		"TextDrawBoxColor",
		"TextDrawSetShadow",
		"TextDrawSetOutline",
		"TextDrawBackgroundColor",
		"TextDrawFont",
		"TextDrawSetProportional",
		"TextDrawShowForPlayer",
		"TextDrawHideForPlayer",
		"TextDrawShowForAll",
		"TextDrawHideForAll",

		// MySQL
		"mysql_connect",
		"mysql_num_rows",
		"mysql_query",
		"mysql_fetch_field_row",
		"mysql_fetch_row_format",
		"mysql_store_result",
		"mysql_free_result"
	};

	static const Native SendClientMessage =					{ "SendClientMessage","iis" };
	static const Native SendClientMessageToAll =			{ "SendClientMessageToAll","is" };
	static const Native SendDeathMessage =					{ "SendDeathMessage","iii" };
	static const Native GameTextForAll =					{ "GameTextForAll","sii" };
	static const Native GameTextForPlayer =					{ "GameTextForPlayer",	"isii" };
	static const Native GetTickCount =						{ "GetTickCount","" };
	static const Native GetMaxPlayers =						{ "GetMaxPlayers",	"" };
	static const Native SetGameModeText =					{  "SetGameModeText","s" };
	static const Native SetTeamCount =						{  "SetTeamCount", "i" };
	static const Native AddPlayerClass =					{ "AddPlayerClass","iffffiiiiii" };
	static const Native AddPlayerClassEx =					{ "AddPlayerClassEx","iiffffiiiiii" };
	static const Native AddStaticVehicle =					{ "AddStaticVehicle","iffffii" };
	static const Native AddStaticVehicleEx =				{ "AddStaticVehicleEx","iffffiii" };
	static const Native AddStaticPickup =					{ "AddStaticPickup","iifff" };
	static const Native ShowNameTags =						{ "ShowNameTags","i" };
	static const Native ShowPlayerMarkers =					{ "ShowPlayerMarkers",	"i" };
	static const Native GameModeExit =						{ "GameModeExit","" };
	static const Native SetWorldTime =						{"SetWorldTime","i" };
	static const Native GetWeaponName =						{ "GetWeaponName",	"ivi" };
	static const Native EnableTirePopping =					{ "EnableTirePopping","i" };
	static const Native AllowInteriorWeapons =				{ "AllowInteriorWeapons","i" };
	static const Native SetWeather =						{ "SetWeather","i" };
	static const Native SetGravity =						{ "SetGravity","f" };
	static const Native AllowAdminTeleport =				{  "AllowAdminTeleport","i" };
	static const Native SetDeathDropAmount =				{ "SetDeathDropAmount","i" };
	static const Native CreateExplosion =					{ "CreateExplosion","fffif" };
	static const Native EnableZoneNames =					{ "EnableZoneNames","i" };
	static const Native IsPlayerAdmin =						{ "IsPlayerAdmin",	"i" };
	static const Native Kick =								{ "Kick","i" };
	static const Native Ban =								{ "Ban",	"i" };
	static const Native SendRconCommand =					{ "SendRconCommand",	"s" };
	static const Native ShowPlayerDialog =					{ "ShowPlayerDialog",	"dddssss"};

	// a_players.inc
	static const Native SetSpawnInfo =						{ "SetSpawnInfo","iiiffffiiiiii" };
	static const Native SpawnPlayer =						{ "SpawnPlayer","i" };
	static const Native SetPlayerPos =						{ "SetPlayerPos","ifff" };
	static const Native GetPlayerPos =						{ "GetPlayerPos","ivvv" };
	static const Native SetPlayerFacingAngle =				{ "SetPlayerFacingAngle","if" };
	static const Native GetPlayerFacingAngle =				{ "GetPlayerFacingAngle","iv" };
	static const Native SetPlayerInterior =					{ "SetPlayerInterior",	"ii" };
	static const Native GetPlayerInterior =					{ "GetPlayerInterior",	"i" };
	static const Native SetPlayerHealth =					{ "SetPlayerHealth",						"if" };
	static const Native GetPlayerHealth =					{ "GetPlayerHealth",						"iv" };
	static const Native SetPlayerArmour =					{ "SetPlayerArmour",						"if" };
	static const Native GetPlayerArmour =					{ "GetPlayerArmour",						"iv" };
	static const Native SetPlayerAmmo =						{ "SetPlayerAmmo",						"iii" };
	static const Native GetPlayerAmmo =						{ "GetPlayerAmmo",						"i" };
	static const Native SetPlayerTeam =						{ "SetPlayerTeam",						"ii" };
	static const Native GetPlayerTeam =						{ "GetPlayerTeam",						"i" };
	static const Native SetPlayerScore =					{  "SetPlayerScore",						"ii" };
	static const Native GetPlayerScore =					{  "GetPlayerScore",						"i" };
	static const Native SetPlayerColor =					{  "SetPlayerColor",						"ii" };
	static const Native GetPlayerColor =					{  "GetPlayerColor",						"i" };
	static const Native SetPlayerSkin =						{  "SetPlayerSkin",						"ii" };
	static const Native GivePlayerWeapon =					{  "GivePlayerWeapon",					"iii" };
	static const Native ResetPlayerWeapons =				{ "ResetPlayerWeapons",					"i" };
	static const Native GetPlayerWeaponData =				{  "GetPlayerWeaponData",					"iiiviv " };
	static const Native GivePlayerMoney =					{  "GivePlayerMoney",						"ii" };
	static const Native ResetPlayerMoney =					{  "ResetPlayerMoney",					"i" };
	static const Native SetPlayerName =						{  "SetPlayerName",						"is" };
	static const Native GetPlayerMoney =					{  "GetPlayerMoney",						"i" };
	static const Native GetPlayerState =					{  "GetPlayerState",						"i" };
	static const Native GetPlayerIp =						{  "GetPlayerIp",							"ipi" };
	static const Native GetPlayerPing =						{  "GetPlayerPing",						"i" };
	static const Native GetPlayerWeapon =					{  "GetPlayerWeapon",						"i" };
	static const Native GetPlayerKeys =						{  "GetPlayerKeys",						"ivvv" };
	static const Native GetPlayerName =						{  "GetPlayerName",						"ipi" };
	static const Native PutPlayerInVehicle =				{  "PutPlayerInVehicle",					"iii" };
	static const Native GetPlayerVehicleID =				{  "GetPlayerVehicleID",					"i" };
	static const Native RemovePlayerFromVehicle =			{  "RemovePlayerFromVehicle",				"i" };
	static const Native TogglePlayerControllable =			{  "TogglePlayerControllable",			"ii" };
	static const Native PlayerPlaySound =					{  "PlayerPlaySound",						"iifff" };
	static const Native SetPlayerCheckpoint =				{  "SetPlayerCheckpoint",					"iffff" };
	static const Native DisablePlayerCheckpoint =			{  "DisablePlayerCheckpoint",				"i" };
	static const Native SetPlayerRaceCheckpoint =			{  "SetPlayerRaceCheckpoint",				"iifffffff" };
	static const Native DisablePlayerRaceCheckpoint =		{  "DisablePlayerRaceCheckpoint",			"i" };
	static const Native SetPlayerWorldBounds =				{  "SetPlayerWorldBounds",				"iffff" };
	static const Native SetPlayerMarkerForPlayer =			{  "SetPlayerMarkerForPlayer",			"iii" };
	static const Native ShowPlayerNameTagForPlayer =		{  "ShowPlayerNameTagForPlayer",			"iii" };
	static const Native SetPlayerMapIcon =					{  "SetPlayerMapIcon",					"iifffii" };
	static const Native RemovePlayerMapIcon =				{  "RemovePlayerMapIcon",					"ii" };
	static const Native SetPlayerCameraPos =				{  "SetPlayerCameraPos",					"ifff" };
	static const Native SetPlayerCameraLookAt =				{  "SetPlayerCameraLookAt",				"ifff" };
	static const Native SetCameraBehindPlayer =				{  "SetCameraBehindPlayer",				"i" };
	static const Native AllowPlayerTeleport =				{  "AllowPlayerTeleport",					"ii" };
	static const Native IsPlayerConnected =					{  "IsPlayerConnected"					"i" };
	static const Native IsPlayerInVehicle =					{  "IsPlayerInVehicle",					"ii" };
	static const Native IsPlayerInAnyVehicle =				{  "IsPlayerInAnyVehicle",				"i" };
	static const Native IsPlayerInCheckpoint =				{  "IsPlayerInCheckpoint",				"i" };
	static const Native IsPlayerInRaceCheckpoint =			{  "IsPlayerInRaceCheckpoint",			"i" };
	static const Native SetPlayerTime =						{  "SetPlayerTime",						"iii" };
	static const Native TogglePlayerClock =					{  "TogglePlayerClock",					"ii" };
	static const Native SetPlayerWeather =					{  "SetPlayerWeather",					"ii" };
	static const Native GetPlayerTime =						{  "GetPlayerTime",						"ivv" };
	static const Native SetPlayerVirtualWorld =				{  "SetPlayerVirtualWorld",				"ii" };
	static const Native GetPlayerVirtualWorld =				{  "GetPlayerVirtualWorld",				"i" };

	// a_vehicle.inc
	static const Native CreateVehicle =						{  "CreateVehicle",						"iffffiii" };
	static const Native DestroyVehicle =					{  "DestroyVehicle",						"i" };
	static const Native GetVehiclePos =						{  "GetVehiclePos",						"ivvv" };
	static const Native SetVehiclePos =						{  "SetVehiclePos",						"ifff" };
	static const Native GetVehicleZAngle =					{  "GetVehicleZAngle",					"iv" };
	static const Native SetVehicleZAngle =					{  "SetVehicleZAngle",					"if" };
	static const Native SetVehicleParamsForPlayer =			{  "SetVehicleParamsForPlayer",			"iiii" };
	static const Native SetVehicleToRespawn =				{  "SetVehicleToRespawn",					"i" };
	static const Native LinkVehicleToInterior =				{ "LinkVehicleToInterior",				"ii" };
	static const Native AddVehicleComponent =				{  "AddVehicleComponent",					"ii" };
	static const Native ChangeVehicleColor =				{ "ChangeVehicleColor",					"iii" };
	static const Native ChangeVehiclePaintjob =				{  "ChangeVehiclePaintjob",				"ii" };
	static const Native SetVehicleHealth =					{  "SetVehicleHealth",					"if" };
	static const Native GetVehicleHealth =					{  "GetVehicleHealth",					"iv" };
	static const Native AttachTrailerToVehicle =			{  "AttachTrailerToVehicle",				"ii" };
	static const Native DetachTrailerFromVehicle =			{  "DetachTrailerFromVehicle",			"i" };
	static const Native IsTrailerAttachedToVehicle =		{  "IsTrailerAttachedToVehicle",			"i" };
	static const Native GetVehicleModel =					{  "GetVehicleModel",					"d"};
	static const Native SetVehicleNumberPlate =				{  "SetVehicleNumberPlate",				"is" };
	static const Native SetVehicleVirtualWorld =			{  "SetVehicleVirtualWorld",				"ii" };
	static const Native GetVehicleVirtualWorld =			{  "GetVehicleVirtualWorld",				"i" };
	static const Native ApplyAnimation =					{ "ApplyAnimation",						"issfiiiii" };

	// a_objects.inc
	static const Native CreateObject =						{ "CreateObject",						"ifffffff" };
	static const Native SetObjectPos =						{  "SetObjectPos",						"ifff" };
	static const Native GetObjectPos =						{  "GetObjectPos",						"ivvv" };
	static const Native SetObjectRot =						{  "SetObjectRot",						"ifff" };
	static const Native GetObjectRot =						{  "GetObjectRot",						"ivvv" };
	static const Native IsValidObject =						{  "IsValidObject",						"i" };
	static const Native DestroyObject =						{  "DestroyObject",						"i" };
	static const Native MoveObject =						{  "MoveObject",							"iffff" };
	static const Native StopObject =						{  "StopObject ",							"i" };
	static const Native CreatePlayerObject =				{  "CreatePlayerObject",					"iiffffff" };
	static const Native SetPlayerObjectPos =				{  "SetPlayerObjectPos",					"iifff" };
	static const Native GetPlayerObjectPos =				{  "GetPlayerObjectPos",					"iivvv" };
	static const Native GetPlayerObjectRot =				{  "GetPlayerObjectRot",					"iivvv" };
	static const Native SetPlayerObjectRot =				{  "SetPlayerObjectRot",					"iifff" };
	static const Native IsValidPlayerObject =				{  "IsValidPlayerObject",					"ii" };
	static const Native DestroyPlayerObject =				{  "DestroyPlayerObject",					"ii" };
	static const Native MovePlayerObject =					{  "MovePlayerObject",					"iiffff" };
	static const Native StopPlayerObject =					{  "StopPlayerObject",					"ii" };

	// Menu's
	static const Native CreateMenu =						{  "CreateMenu",							"siffff" };
	static const Native DestroyMenu =						{  "DestroyMenu",							"i" };
	static const Native AddMenuItem =						{  "AddMenuItem",							"iis" };
	static const Native SetMenuColumnHeader =				{  "SetMenuColumnHeader",					"iis" };
	static const Native ShowMenuForPlayer =					{  "ShowMenuForPlayer",					"ii" };
	static const Native HideMenuForPlayer =					{  "HideMenuForPlayer",					"ii" };
	static const Native IsValidMenu =						{  "IsValidMenu",							"i" };
	static const Native DisableMenu =						{  "DisableMenu",							"i" };
	static const Native DisableMenuRow =					{  "DisableMenuRow",						"ii" };

	// Textdraw
	static const Native TextDrawCreate =					{ "TextDrawCreate",						"ffs" };
	static const Native TextDrawDestroy =					{  "TextDrawDestroy",						"i" };
	static const Native TextDrawLetterSize =				{ "TextDrawLetterSize",					"iff" };
	static const Native TextDrawTextSize =					{  "TextDrawTextSize",					"iff" };
	static const Native TextDrawAlignment =					{  "TextDrawAlignment",					"ii" };
	static const Native TextDrawColor =						{  "TextDrawColor",						"ii" };
	static const Native TextDrawUseBox =					{  "TextDrawUseBox",						"ii" };
	static const Native TextDrawBoxColor =					{  "TextDrawBoxColor",					"ii" };
	static const Native TextDrawSetShadow =					{  "TextDrawSetShadow",					"ii" };
	static const Native TextDrawSetOutline =				{  "TextDrawSetOutline",					"ii" };
	static const Native TextDrawBackgroundColor =			{  "TextDrawBackgroundColor",				"ii" };
	static const Native TextDrawFont =						{ "TextDrawFont",						"ii" };
	static const Native TextDrawSetProportional =			{  "TextDrawSetProportional",				"ii" };
	static const Native TextDrawShowForPlayer =				{  "TextDrawShowForPlayer",				"ii" };
	static const Native TextDrawHideForPlayer =				{  "TextDrawHideForPlayer",				"ii" };
	static const Native TextDrawShowForAll =				{ "TextDrawShowForAll",					"i" };
	static const Native TextDrawHideForAll =				{ "TextDrawHideForAll",					"i" };

	// Janus MySQL
	static const Native mysql_connect =				{ "mysql_connect", "ssss" };
	static const Native mysql_query =				{ "mysql_query", "siii" };
	static const Native mysql_num_rows =			{ "mysql_num_rows", "i" };
	static const Native mysql_close =				{ "mysql_close", "i" };
	static const Native mysql_fetch_row_format =	{ "mysql_fetch_row_format", "ssi" };
	static const Native mysql_fetch_field_row =		{ "mysql_fetch_field_rows", "ssi" };
	static const Native mysql_store_result =		{ "mysql_store_result", "i" };
	static const Native mysql_free_result =			{ "mysql_free_result", "i" };


};

class
	Janus
{
public:
	Janus()
	{
		gotAddresses = false;
	}


	int cagir(const PAWN::Native * native, ...);
	int getAddresses();

	int amx_idx;

	std::list<AMX *> amx_list;
private:
	bool gotAddresses;

	std::map<std::string, unsigned int> amx_map;
};

typedef int (* amx_Function_t)(AMX * amx, cell * params);

/*extern*/ Janus *janusFonksiyon;





Janus.cpp



Janus.cpp

#include "Janus.h"

Janus * _janus;

int Janus::callNative(const PAWN::Native * native, ...)
{
	if (amx_list.empty() || amx_map.find(native->name) == amx_map.end())
	{
		return 0;
	}

	unsigned int amx_addr = amx_map[native->name], count = strlen(native->data), variables = 0;
	cell * params = new cell[count + 1], * physAddr[6];
	params[0] = count * sizeof(cell);
	va_list input;
	va_start(input, native);
	for (unsigned int i = 0; i < count; ++i)
	{
		switch (native->data[i])
		{
			case 'd':
			case 'i':
			{
				params[i + 1] = va_arg(input, int);
			}
			break;
			case 'f':
			{
				float value = (float)va_arg(input, double);
				params[i + 1] = amx_ftoc(value);
			}
			break;
			case 's':
			{
				char * string = va_arg(input, char *);
				amx_Allot(amx_list.front(), strlen(string) + 1, ¶ms[i + 1], &physAddr[variables++]);
				amx_SetString(physAddr[variables - 1], string, 0, 0, strlen(string) + 1);
			}
			break;
			case 'v':
			{
				va_arg(input, void *);
				amx_Allot(amx_list.front(), 1, ¶ms[i + 1], &physAddr[variables++]);
			}
			break;
			case 'p':
			{
				va_arg(input, void *);
				int size = va_arg(input, int);
				amx_Allot(amx_list.front(), size, ¶ms[++i], &physAddr[variables++]);
				params[i + 1] = size;
			}
			break;
		}
	}
	va_end(input);
	amx_Function_t amx_Function = (amx_Function_t)amx_addr;
	int value = amx_Function(amx_list.front(), params);
	if (variables)
	{
		variables = 0;
		va_start(input, native);
		for (unsigned int i = 0; i < count; ++i)
		{
			switch (native->data[i])
			{
				case 's':
				{
					amx_Release(amx_list.front(), params[i + 1]);
				}
				break;
				case 'v':
				{
					unsigned int * value = va_arg(input, unsigned int *), * returnValue = (unsigned int *)physAddr[variables++];
					* value = * returnValue;
					amx_Release(amx_list.front(), params[i + 1]);
				}
				break;
				case 'p':
				{
					char * text = va_arg(input, char *);
					int size = va_arg(input, int);
					amx_GetString(text, physAddr[variables++], 0, size);
					amx_Release(amx_list.front(), params[++i]);
				}
				break;
				default:
				{
					va_arg(input, void *);
				}
				break;
			}
		}
		va_end(input);
	}
	delete [] params;
	return value;
}

int Janus::getAddresses()
{
	if (gotAddresses)
	{
		return 1;
	}
	AMX_HEADER * amx_hdr = (AMX_HEADER *)(amx_list.back())->base;
	std::size_t size = sizeof(PAWN::names) / sizeof(const char *);
	for (std::size_t i = 0; i < size; ++i)
	{
		amx_FindNative(amx_list.back(), PAWN::names[i], &amx_idx);
		if (amx_idx != std::numeric_limits<int>::max())
		{
			unsigned int amx_addr = (unsigned int)((AMX_FUNCSTUB *)((char *)amx_hdr + amx_hdr->natives + amx_hdr->defsize * amx_idx))->address;
			if (amx_addr)
			{
				if (amx_map.find(PAWN::names[i]) == amx_map.end())
				{
					amx_map.insert(std::make_pair(PAWN::names[i], amx_addr));
				}
			}
		}
	}
	if (amx_map.size() == size)
	{
		gotAddresses = true;
		return 1;
	}
	return 0;
}





JanusDef.cpp



JanusDef.cpp

// Kütüphaneler
#include "Janus.h"
#include "JanusDef.h"

void *pAMXFonksiyonlar;
typedef void (*konsolYazdir)(char* format, ...);
konsolYazdir konsol;
	
// Nativeler
cell AMX_NATIVE_CALL JanusOyuncuData(AMX* amx, cell* parametre)
{
	if (janusFonksiyon->cagir(&PAWN::IsPlayerConnected, parametre[1]))
	{
		oyuncuPara = janusFonksiyon->cagir(&PAWN::GetPlayerMoney, parametre[1]);
		oyuncuSkor = janusFonksiyon->cagir(&PAWN::GetPlayerScore, parametre[1]);
		oyuncuInterior = janusFonksiyon->cagir(&PAWN::GetPlayerInterior, parametre[1]);
		oyuncuVitualWorld = janusFonksiyon->cagir(&PAWN::GetPlayerVirtualWorld, parametre[1]);
		oyuncuKarater = janusFonksiyon->cagir(&PAWN::SetPlayerSkin, parametre[1]);
		janusFonksiyon->cagir(&PAWN::GetPlayerPos, parametre[1], &oyuncuX, &oyuncuY, &oyuncuZ);
		janusFonksiyon->cagir(&PAWN::GetPlayerFacingAngle, parametre[1], &oyuncuAngle);
	}
	return 1;
}

PLUGIN_EXPORT unsigned int PLUGIN_CALL Supports() 
{
    return SUPPORTS_VERSION | SUPPORTS_AMX_NATIVES | SUPPORTS_PROCESS_TICK;
}

PLUGIN_EXPORT bool PLUGIN_CALL Load(void **ppData) 
{
	janusFonksiyon = new Janus;

	pAMXFonksiyonlar = ppData[PLUGIN_DATA_AMX_EXPORTS];
	konsol = (konsolYazdir) ppData[PLUGIN_DATA_LOGPRINTF];

	konsol("* Copyright (c) 2013 Janus Eğlence Sunucuları - All Right Reserved *");
    return true;
}

PLUGIN_EXPORT void PLUGIN_CALL Unload()
{
	konsol("Copyright (c) 2013 Janus Eğlence Sunucuları - All Right Reserved\n");
	konsol("\n");
	konsol("Plug-In Versiyon: 1.0.0 ALPHA");
}

PLUGIN_EXPORT int PLUGIN_CALL AmxLoad (AMX *amx)
{
	return 1;
}

PLUGIN_EXPORT int PLUGIN_CALL AmxUnload( AMX *amx ) 
{
	return 1;
}

推荐答案

The error says Janus::cagir is used and declared but never defined. Where is the source that includes that method?



It should either be part of a cpp/c source file or... it should be part of a library that you need to tell your linker about.
The error says Janus::cagir is used and declared but never defined. Where is the source that includes that method?

It should either be part of a cpp/c source file or... it should be part of a library that you need to tell your linker about.


An undefined external symbol (symbol) was found in function. To resolve this error, provide a definition for symbol or remove the code that references it

LNK2019 can also occur when a static data member is declared but not defined



The declaration of the symbol is not spelled the same as the definition of the symbol.



A function was used but the type or number of the parameters did not match the function
An undefined external symbol (symbol) was found in function. To resolve this error, provide a definition for symbol or remove the code that references it
LNK2019 can also occur when a static data member is declared but not defined

The declaration of the symbol is not spelled the same as the definition of the symbol.

A function was used but the type or number of the parameters did not match the function


Ok here is the error line,



Ok here is the error line,

int fonksiyonCagir(const PAWN::Nativex * native, ...);





and when i use this code, im getting that error.





and when i use this code, im getting that error.

int a = Janus->fonksiyonCagir(&PAWN::GetPlayerInterior, parametreler[1]);


这篇关于Visual C ++ - 错误LNK2019的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆