1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_SetGameModeText referenced in function "bool __cdecl SetGameModeText(char const *)" (?SetGameModeText@@YA_NPBD@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_AddPlayerClass referenced in function "int __cdecl AddPlayerClass(int,float,float,float,float,int,int,int,int,int,int)" (?AddPlayerClass@@YAHHMMMMHHHHHH@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_SetTimer referenced in function "int __cdecl SetTimer(int,bool,void (__cdecl*)(int,void *),void *)" (?SetTimer@@YAHH_NP6AXHPAX@Z1@Z) 1>main.obj : error LNK2001: unresolved external symbol __imp__sampgdk_vlogprintf 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_SendClientMessage referenced in function "bool __cdecl SendClientMessage(int,int,char const *)" (?SendClientMessage@@YA_NHHPBD@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_SetPlayerPos referenced in function "bool __cdecl SetPlayerPos(int,float,float,float)" (?SetPlayerPos@@YA_NHMMM@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_SetPlayerCameraPos referenced in function "bool __cdecl SetPlayerCameraPos(int,float,float,float)" (?SetPlayerCameraPos@@YA_NHMMM@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_SetPlayerCameraLookAt referenced in function "bool __cdecl SetPlayerCameraLookAt(int,float,float,float,int)" (?SetPlayerCameraLookAt@@YA_NHMMMH@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_GetPlayerPos referenced in function "bool __cdecl GetPlayerPos(int,float *,float *,float *)" (?GetPlayerPos@@YA_NHPAM00@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_init_plugin referenced in function "public: int __thiscall Plugin::Load(void * *)" (?Load@Plugin@@QAEHPAPAX@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_cleanup_plugin referenced in function "public: int __thiscall Plugin::Unload(void)" (?Unload@Plugin@@QAEHXZ) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_process_plugin_timers referenced in function "public: void __thiscall Plugin::ProcessTimers(void)" (?ProcessTimers@Plugin@@QAEXXZ) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_GetPlayerName referenced in function "bool __cdecl GetPlayerName(int,char *,int)" (?GetPlayerName@@YA_NHPADH@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_get_plugin_handle referenced in function "public: __thiscall ThisPlugin::ThisPlugin(void)" (??0ThisPlugin@@QAE@XZ)
link to the static library and enable the definition for static compiling
|
1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_SendClientMessage referenced in function "bool __cdecl SendClientMessage(int,int,char const *)" (?SendClientMessage@@YA_NHHPBD@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_SetGameModeText referenced in function "bool __cdecl SetGameModeText(char const *)" (?SetGameModeText@@YA_NPBD@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_AddPlayerClass referenced in function "int __cdecl AddPlayerClass(int,float,float,float,float,int,int,int,int,int,int)" (?AddPlayerClass@@YAHHMMMMHHHHHH@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_SetTimer referenced in function "int __cdecl SetTimer(int,bool,void (__cdecl*)(int,void *),void *)" (?SetTimer@@YAHH_NP6AXHPAX@Z1@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_SetPlayerPos referenced in function "bool __cdecl SetPlayerPos(int,float,float,float)" (?SetPlayerPos@@YA_NHMMM@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_GetPlayerPos referenced in function "bool __cdecl GetPlayerPos(int,float *,float *,float *)" (?GetPlayerPos@@YA_NHPAM00@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_GetPlayerName referenced in function "bool __cdecl GetPlayerName(int,char *,int)" (?GetPlayerName@@YA_NHPADH@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_SetPlayerCameraPos referenced in function "bool __cdecl SetPlayerCameraPos(int,float,float,float)" (?SetPlayerCameraPos@@YA_NHMMM@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_SetPlayerCameraLookAt referenced in function "bool __cdecl SetPlayerCameraLookAt(int,float,float,float,int)" (?SetPlayerCameraLookAt@@YA_NHMMMH@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_init_plugin referenced in function "public: int __thiscall Plugin::Load(void * *)" (?Load@Plugin@@QAEHPAPAX@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_cleanup_plugin referenced in function "public: int __thiscall Plugin::Unload(void)" (?Unload@Plugin@@QAEHXZ) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_get_plugin_handle referenced in function "public: __thiscall ThisPlugin::ThisPlugin(void)" (??0ThisPlugin@@QAE@XZ) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_process_plugin_timers referenced in function "public: void __thiscall Plugin::ProcessTimers(void)" (?ProcessTimers@Plugin@@QAEXXZ) 1>main.obj : error LNK2001: unresolved external symbol __imp__sampgdk_vlogprintf
error C2664: 'SetTimer' : no se puede convertir el parбmetro 3 de 'int (__cdecl *)(int,void *)' a 'TimerCallback'
How i'm supossed to fix this error?
pawn Код:
|
I'm getting the same issue as the above user however I've tried both dynamic and static and still getting same issues. Any ideas?
Код:
1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_SendClientMessage referenced in function "bool __cdecl SendClientMessage(int,int,char const *)" (?SendClientMessage@@YA_NHHPBD@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_SetGameModeText referenced in function "bool __cdecl SetGameModeText(char const *)" (?SetGameModeText@@YA_NPBD@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_AddPlayerClass referenced in function "int __cdecl AddPlayerClass(int,float,float,float,float,int,int,int,int,int,int)" (?AddPlayerClass@@YAHHMMMMHHHHHH@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_SetTimer referenced in function "int __cdecl SetTimer(int,bool,void (__cdecl*)(int,void *),void *)" (?SetTimer@@YAHH_NP6AXHPAX@Z1@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_SetPlayerPos referenced in function "bool __cdecl SetPlayerPos(int,float,float,float)" (?SetPlayerPos@@YA_NHMMM@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_GetPlayerPos referenced in function "bool __cdecl GetPlayerPos(int,float *,float *,float *)" (?GetPlayerPos@@YA_NHPAM00@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_GetPlayerName referenced in function "bool __cdecl GetPlayerName(int,char *,int)" (?GetPlayerName@@YA_NHPADH@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_SetPlayerCameraPos referenced in function "bool __cdecl SetPlayerCameraPos(int,float,float,float)" (?SetPlayerCameraPos@@YA_NHMMM@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_SetPlayerCameraLookAt referenced in function "bool __cdecl SetPlayerCameraLookAt(int,float,float,float,int)" (?SetPlayerCameraLookAt@@YA_NHMMMH@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_init_plugin referenced in function "public: int __thiscall Plugin::Load(void * *)" (?Load@Plugin@@QAEHPAPAX@Z) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_cleanup_plugin referenced in function "public: int __thiscall Plugin::Unload(void)" (?Unload@Plugin@@QAEHXZ) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_get_plugin_handle referenced in function "public: __thiscall ThisPlugin::ThisPlugin(void)" (??0ThisPlugin@@QAE@XZ) 1>main.obj : error LNK2019: unresolved external symbol __imp__sampgdk_process_plugin_timers referenced in function "public: void __thiscall Plugin::ProcessTimers(void)" (?ProcessTimers@Plugin@@QAEXXZ) 1>main.obj : error LNK2001: unresolved external symbol __imp__sampgdk_vlogprintf I've even tried using an older GDK however still no improvements. |
This is fully compatible with linux right? If so how would I go about compiling the plugin into .so? I'm using centos 6
|
Timer functions return "void", not "int". In C++ if you don't specify the return type it defaults to "int".
|
Timer functions return "void", not "int". In C++ if you don't specify the return type it defaults to "int".
|
SetTimer(tasa, true, (void)ComprobaciondeVehiculos, NULL);
sampgdk_find_native(const char *name) sampgdk_call_native(AMX_NATIVE native, cell *params) sampgdk_invoke_native(AMX_NATIVE, const char *format, ...)
'i', 'd' - int
'b' - bool
'f' - float
'r' - const reference ('const cell *' in C)
'R' - non-const reference (output argument) (the C type is 'cell *')
's' - input string ('const char *' in C)
'S' - output string ('char *'), size must be passed in next argument
char name[MAX_PLAYER_NAME}; AMX_NATIVE native = sampgdk_find_native("GetPlayerName"); sampgdk_invoke_native(native, "iSi", playerid, name, sizeof(name));
float x, y, z; AMX_NATIVE native = sampgdk_find_native("GetPlayerPos"); sampgdk_invoke_native(native, "iRRR", playerid, &x, &y, &z);
int CreateDynamicObject(int modelid, float x, float y, float z, float rx, float ry, float rz, int worldid = -1, int interiorid = -1, int playerid = -1, float streamdistance = 200.0f) { return (int)sampgdk_invoke_native(sampgdk_find_native("CreateDynamicObject"), "iffffffiiif", modelid, x, y, z, rx, ry, rz, worldid, interiorid, playerid, streamdistance); }
If anyone cares I released a new version of this (3.6).
What's new:
|
Can somebody figure out why this doesn't work?
(CreateDynamicObject from Incognito's Streamer Plugin) Код:
int CreateDynamicObject(int modelid, float x, float y, float z, float rx, float ry, float rz, int worldid = -1, int interiorid = -1, int playerid = -1, float streamdistance = 200.0f) { return (int)sampgdk_invoke_native(sampgdk_find_native("CreateDynamicObject"), "iffffffiiif", modelid, x, y, z, rx, ry, rz, worldid, interiorid, playerid, streamdistance); } |
Can somebody figure out why this doesn't work?
(CreateDynamicObject from Incognito's Streamer Plugin) Код:
int CreateDynamicObject(int modelid, float x, float y, float z, float rx, float ry, float rz, int worldid = -1, int interiorid = -1, int playerid = -1, float streamdistance = 200.0f) { return (int)sampgdk_invoke_native(sampgdk_find_native("CreateDynamicObject"), "iffffffiiif", modelid, x, y, z, rx, ry, rz, worldid, interiorid, playerid, streamdistance); } |