Help with plugin development in linux - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Plugin Development (
https://sampforum.blast.hk/forumdisplay.php?fid=18)
+--- Thread: Help with plugin development in linux (
/showthread.php?tid=577949)
Help with plugin development in linux -
Daslee - 15.06.2015
Hello guys. Where I can find tutorial about plugin development in linux? I've tried to create simple plugin by looking at this tutorial:
https://sampforum.blast.hk/showthread.php?tid=253436 but it won't compile.. When I compiled it, I got bunch of errors:
http://pastebin.com/7uyGeYiZ
I used this line to compile it:
Code:
g++ -shared -o plugin.so -fPIC plugin.cpp
AW: Help with plugin development in linux -
FSAOskar - 15.06.2015
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:
Correct me if I'm wrong.
Re: Help with plugin development in linux -
Daslee - 15.06.2015
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:
Code:
[16:58:39]
[16:58:39] Server Plugins
[16:58:39] --------------
[16:58:39] Loading plugin: plugin.so
[16:58:39] Failed (plugins/plugin.so: 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:
Code:
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 plugin.so *.o