SA-MP Forums

SA-MP Forums (
-   Plugin Development (
-   -   Help with plugin development in linux (

Daslee 15/06/2015 09:32 AM

Help with plugin development in linux
Hello guys. Where I can find tutorial about plugin development in linux? I've tried to create simple plugin by looking at this tutorial: but it won't compile.. When I compiled it, I got bunch of errors:

I used this line to compile it:

g++ -shared -o -fPIC plugin.cpp

FSAOskar 15/06/2015 12:47 PM

AW: Help with plugin development in linux
I don't have any clue with compiling on linux but it seems like that you gotta define for what system you are compiling the project. Something like:

PHP Code:

#define LINUX 

Correct me if I'm wrong.

Daslee 15/06/2015 02:05 PM

Re: Help with plugin development in linux
Now it compiles after I defined LINUX (actually it also required -m32 flag when compiling). But when server tries to load plugin, it says this:


[16:58:39] Server Plugins
[16:58:39] --------------
[16:58:39]  Loading plugin:
[16:58:39]  Failed (plugins/ undefined symbol: pAMXFunctions)
[16:58:39]  Loaded 0 plugins.

EDIT: Got it working, if someone have same problem, use these lines to compile and link everything:

g++ -m32 -c -fPIC -DLINUX -std=c++0x plugin.cpp
g++ -m32 -c -fPIC -DLINUX SDK/*.cpp
gcc -m32 -c -fPIC -DLINUX SDK/amx/*.c
g++ -m32 -O2 -fshort-wchar -shared -o *.o

All times are GMT. The time now is 09:19 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.