[HELP] My plugin failed to load on host (undefined symbol)
#1

note: if this is the wrong section, please move it and don't lock/delete because i spent a lot of time working on this and i really need help

hello there,

so a few months back i decided to write my own mode in c++ using SAMPGDK for the first time. it all went so good and the plugin (my mode) worked very well on my pc (windows) so i decided to put it on the main box (its linux centos 6) - i had to compile it on a linux machine to get .so files so i used oracle vm and managed to compile it on my pc but when i started up my server i got this error

Code:
Loading plugin: mymode.so
           Failed (plugins/mymode.so: undefined symbol: _ZN7JumpX866RemoveEv)
i thought it gave this error because my pc is 32 bit unlike the host so i installed g++ and all the development tools on my host and compiled my mode, started up the server and the same error

info: my host is centos 6 64 bit, my pc is windows 7 32 bit and im using a very old SAMPGDK version (1.1.0)

i dunno if i need any additional libraries for my g++ to compile samp plugins. if you need any more info feel free to ask

if anyone can help me i will be extremely thankful to them because i spent months working on this as i already stated.

thanks for reading.
Reply
#2

You should seriously consider updating to a newer SampGDK version. It's also always better to compile things on the machine on which it should run, so try compiling on your Linux machine.
Reply
#3

Quote:
Originally Posted by ZoZZ
View Post
so i installed g++ and all the development tools on my host and compiled my mode, started up the server and the same error .
as i already mentioned, i already tried to build it on the host machine but it gave the same error. ah and if i upgrade i will have to rewrite the whole code since the newest sampgdk uses different methods.

can you tell me how do you compile your own plugins on linux?
Reply
#4

I write a makefile and compile it with the make command. Download any plugin (but not the Streamer plugin) and have a look at their makefile.
And it looks like the plugin wants to use some Windows function on Linux, so take a look at your code and see if you are trying to compile Windows includes on Linux.
Reply
#5

man real thanks for trying to help me. i think this file has something to do with the error its a part of the SAMPGDK (jump-x86.cpp)

http://pastebin.com/YvuaQq7g

maybe because windows.h is included there but i think that part is ignored on linux.
Reply
#6

Hm, try compiling with g++ with the -m32 flag, maybe this will solve your problem.
Reply
#7

you mean these

Code:
CFLAGS    += $(CPPFLAGS) $(ARCH) -m32
CXXFLAGS  += $(CFLAGS)
? if not then how?

btw this is my makefile (for sampgdk not my mode but if you want it ok) if you need to check

http://pastebin.com/B3AVWSDt


i also forgot to say that a friend of mine compiled his plugin using the same sampgdk but i have no idea about the type of the machine he compiled it on or the host. but unfortunately i dont seem to find him online anywhere. i want to say that i think its a problem with the compiler i use, perhaps its too new for this old sampgdk (my g++ is v 4.4.7 on centos 6)? if so how can i downgrade?


edit:
can i know your g++ version and your linux distro? and tell me if you installed any additional things to your compiler?
Reply
#8

The problem is not the compiler. It looks like you compile your plugin together with the sampgdk. You should compile them separate and then link the sampgdk to your plugin. And seriously, update the sampgdk. It shouldn't be too hard to change your code to a newer version.
Reply
#9

no i build sampgdk first then mymode and could you answer my questions please?

Quote:

can i know your g++ version and your linux distro? and tell me if you installed any additional things to your compiler?

Reply
#10

How do you compile your mode?
I'm using Debian 7 with g++ 4.7, I don't think this information will bring you further.
Reply
#11

i use make to compile sampgdk and generate the file "libsampgdk.a" then compile "mymode.make" (click here)
Reply
#12

http://pastebin.com/TP0YmYV4
Try this makefile. You'll have to adjust the directories.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)