16.01.2012, 19:10
Olб,
Hoje fui tentar fazer um plugin, mas quando vai compilar da 2 erros chatos:
Eu nгo sei o que pode ser, e jб que estou iniciando em C++ gostaria que alguйm me ajudasse a resolver esse problema.
Aqui vai o code:
Plugin_Source.cpp
md.def
Compiler Log:
Agradeзo desde jб.
Hoje fui tentar fazer um plugin, mas quando vai compilar da 2 erros chatos:
Код:
Error 1 error LNK2001: unresolved external symbol "void * pAMXFunctions" (?pAMXFunctions@@3PAXA) Plugin_Source.obj Error 2 error LNK2019: unresolved external symbol _amx_Register referenced in function _AmxLoad@4 Plugin_Source.obj Error 3 fatal error LNK1120: 2 unresolved externals C:\Documents and Settings\Victor-17-10-2011\Meus documentos\Visual Studio 2008\Projects\SA-MP Plugin - Teste\Debug\PluginTeste.dll 1
Aqui vai o code:
Plugin_Source.cpp
pawn Код:
#include "../SDK/plugin.h"
#define MAX_NATIVES 1
typedef void (*logprintf_t)(char* format, ...); logprintf_t logprintf;
void **ppPluginData;
extern void *pAMXFunctions;
PLUGIN_EXPORT bool PLUGIN_CALL Load(void **ppData) {
pAMXFunctions = ppData[PLUGIN_DATA_AMX_EXPORTS];
logprintf = (logprintf_t)ppData[PLUGIN_DATA_LOGPRINTF];
return 1;
}
PLUGIN_EXPORT void PLUGIN_CALL Unload() {
logprintf("/t Plugin Teste Descarregando!");
}
PLUGIN_EXPORT unsigned int PLUGIN_CALL Supports() {
return SUPPORTS_VERSION | SUPPORTS_AMX_NATIVES;
}
cell AMX_NATIVE_CALL NativeTeste(AMX *amx, cell *params) {
logprintf("/t Callback chamada: NativeTeste();!");
return 1;
}
AMX_NATIVE_INFO NATIVES[MAX_NATIVES] =
{
{ "NativeTeste", NativeTeste }
};
PLUGIN_EXPORT int PLUGIN_CALL AmxLoad(AMX *amx) {
return amx_Register(amx, NATIVES, -1);
}
PLUGIN_EXPORT int PLUGIN_CALL AmxUnload(AMX *amx) {
return AMX_ERR_NONE;
}
md.def
pawn Код:
EXPORTS
Load
Unload
Supports
AmxLoad
AmxUnload
Compiler Log:
Код:
------ Build started: Project: PluginTeste, Configuration: Debug Win32 ------ Compiling... Plugin_Source.cpp Linking... Creating library C:\Documents and Settings\Victor-17-10-2011\Meus documentos\Visual Studio 2008\Projects\SA-MP Plugin - Teste\Debug\PluginTeste.lib and object C:\Documents and Settings\Victor-17-10-2011\Meus documentos\Visual Studio 2008\Projects\SA-MP Plugin - Teste\Debug\PluginTeste.exp Plugin_Source.obj : error LNK2001: unresolved external symbol "void * pAMXFunctions" (?pAMXFunctions@@3PAXA) Plugin_Source.obj : error LNK2019: unresolved external symbol _amx_Register referenced in function _AmxLoad@4 C:\Documents and Settings\Victor-17-10-2011\Meus documentos\Visual Studio 2008\Projects\SA-MP Plugin - Teste\Debug\PluginTeste.dll : fatal error LNK1120: 2 unresolved externals Build log was saved at "file://c:\Documents and Settings\Victor-17-10-2011\Meus documentos\Visual Studio 2008\Projects\SA-MP Plugin - Teste\SA-MP Plugin - Teste\Debug\BuildLog.htm" PluginTeste - 3 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========