[Help] Errors in SDK
#1

Hey guys,

I have a few problems with my first plugin ;(

"plugin.cpp"
Code:
#include "SDK/plugin.h"

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()
{
}

AMX_NATIVE_INFO projectNatives[] =
{
   { 0, 0 }
};


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

PLUGIN_EXPORT int PLUGIN_CALL AmxLoad(AMX *amx)
{
   return amx_Register(amx, projectNatives, -1);
}

PLUGIN_EXPORT int PLUGIN_CALL AmxUnload(AMX *amx)
{
   return AMX_ERR_NONE;
}
And those Errors:

Code:
Compiler: Default compiler
Building Makefile: "F:\samp\plugin\Makefile.win"
Fьhrt  make... aus
make.exe -f "F:\samp\plugin\Makefile.win" all
g++.exe -c plugin.cpp -o plugin.o -I"C:/CPP/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"  -I"C:/CPP/Dev-Cpp/include/c++/3.4.2/backward"  -I"C:/CPP/Dev-Cpp/include/c++/3.4.2/mingw32"  -I"C:/CPP/Dev-Cpp/include/c++/3.4.2"  -I"C:/CPP/Dev-Cpp/include"  -DBUILDING_DLL=1 

In file included from SDK/plugin.h:9,
                 from plugin.cpp:1:
SDK/amx/amx.h:64: error: `__int64' does not name a type
SDK/amx/amx.h:65: error: `__int64' does not name a type

SDK/amx/amx.h:368: error: expected constructor, destructor, or type conversion before '*' token
SDK/amx/amx.h:368: error: expected `,' or `;' before '*' token

SDK/amx/amx.h:384: error: `size_t' has not been declared

SDK/amx/amx.h:384: error: ISO C++ forbids declaration of `size' with no type

SDK/amx/amx.h:404: error: `size_t' has not been declared
SDK/amx/amx.h:404: error: ISO C++ forbids declaration of `size' with no type

make.exe: *** [plugin.o] Error 1

Ausfьhrung beendet
I noticed all of them are in the "amx.h" - file, thats includet in the "plugin.cpp", but how to fix them ?

Tion
Reply
#2

Just refollow my tutorial. You probably missed a part.

https://sampforum.blast.hk/showthread.php?tid=253436
Reply
#3

Well, I have a different compiler so I have to change a few steps, but in the mainpoint I used your tutorial

I use the Bloodshed Dev-C++ compiler ( there is an textiditor inthere, too )
Reply
#4

I'm not familiar with Dev-C++ (btw it's not a compiler, it's an IDE) but I see you're compiling with MinGW (the port of gcc for Windows), this post should be helpful to you: http://forum.sa-mp.com/showpost.php?...61&postcount=2
Reply
#5

thanks ill try it tomorrow

Tion
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)