Couldn't compile my plugin to .so
#1

Hi, i made my own plugin in c++ and i compile it into .so library (g++ LyricsPlugin.cpp -m32 -o LyricsPlugin.so) and when i start the server it wrote:

[23:05:00] Loading plugin: LyricsPlugin.so
[23:05:00] Failed (plugins/LyricsPlugin.so: cannot dynamically load executable)

Does anybody know what about it?
Reply
#2

You are missing some required parameters like -shared and -fshort-wchar. Look around in other plugin's makefiles.
Reply
#3

I found:

g++ -O2 -shared -w -o LyricsPlugin.so -I./ -I./amx/ -DLINUX *.cpp

but when i use it it wrote:

/usr/bin/ld: /tmp/ccTSiCDY.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/tmp/ccTSiCDY.o: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
Reply
#4

FINALLY IT WORKS !!!

i used:

g++ -O2 -shared -w -fPIC -m32 -o LyricsPlugin.so -I./ -I./amx/ -DLINUX *.cpp
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)