01.12.2014, 13:07
Quote:
I have a problem when linking to the static library, getting the following runtime error when i connect.
Код:
[debug] Run time error 20: "Invalid index parameter (bad entry point)" I don't get this error when i link to the dynamic lib. I've double checked all the project settings, i'm linking to the correct lib, and SAMPGDK_STATIC is defined. Also using the amalgamation. Note: The function main() exists in the blank mode i have loaded. So that's not what is causing it. |
You just need to define before including sampgdk the following macro: SAMPGDK_AMALGAMATION
Then, you're free to use sampgdk without (using) including the sampgdk (shared) library
Here's an example of the plugin, using SAMPGDK Amalgamation
PHP код:
#define SAMPGDK_AMALGAMATION
#include <sampgdk.h>
PLUGIN_EXPORT bool PLUGIN_CALL Load(void **ppData) { return sampgdk::Load(ppData); }
PLUGIN_EXPORT unsigned int PLUGIN_CALL Supports() { return sampgdk::Supports() | SUPPORTS_PROCESS_TICK;}
PLUGIN_EXPORT void PLUGIN_CALL Unload() { sampgdk::Unload(); }
PLUGIN_EXPORT void PLUGIN_CALL ProcessTick() { sampgdk::ProcessTick(); }