SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 15/06/2015, 09:32 AM   #1
Daslee
Big Clucker
 
Join Date: Jul 2009
Location: Lithuania
Posts: 111
Reputation: 0
Default 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: http://forum.sa-mp.com/showthread.php?t=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
Daslee is offline   Reply With Quote
Old 15/06/2015, 12:47 PM   #2
FSAOskar
Big Clucker
 
Join Date: Feb 2015
Location: Germany
Posts: 67
Reputation: 22
Default 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.
FSAOskar is offline   Reply With Quote
Old 15/06/2015, 02:05 PM   #3
Daslee
Big Clucker
 
Join Date: Jul 2009
Location: Lithuania
Posts: 111
Reputation: 0
Default 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:

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

Last edited by Daslee; 15/06/2015 at 07:29 PM.
Daslee is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tutorial] Plugin development guide Kyosaur Plugin Development 176 12/02/2018 10:35 PM
Please help Plugin On Linux cuchuoixanh Plugin Development 1 27/01/2014 11:11 AM
MapAndreas plugin on linux. RelaxCafe Server Support 2 09/02/2012 06:04 PM
How to complie plugin to linux ? kurta999 Help Archive 2 24/10/2010 07:44 PM


All times are GMT. The time now is 08:38 PM.


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