Raised This Month: $ Target: $400
 0% 

Linux: Unable to load plugin "xxx"


Post New Thread Reply   
 
Thread Tools Display Modes
maitredede
Senior Member
Join Date: May 2005
Old 07-09-2005 , 17:26  
Reply With Quote #11

Quote:
Originally Posted by PM
As the ldd says:
tier0_i486.so => not found
vstdlib_i486.so => not found
Oops, didn't saw that... But that's strange, because they are linked (ln -s) in the dir, like the libmysqlclient.so
I'll try to find why this happens...

EDIT :
Quote:
Originally Posted by fysh
Linux is much better for making server plugins than Windows.
Both are not better than the other. They have both their one specific features, and unfortunately, compiling a plugin for linux is harder (for a nood) than in windows, since in windows, I just have to push Ctrl+Alt+B to get my plugin working...
__________________
make brain && make install
maitredede is offline
maitredede
Senior Member
Join Date: May 2005
Old 07-10-2005 , 05:43  
Reply With Quote #12

Ok, found the reason : the dir where gcc search the .so files but a strange thing... Here is the ldd :
Code:
root@server:/usr/src/half-life/myplugin # ldd -d maitredede_plugin_i486.so
                libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7fbe000)
        libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7fbb000)
        ./tier0_i486.so => ./tier0_i486.so (0xb7f8a000)
        libmysqlclient.so.12 => /usr/lib/libmysqlclient.so.12 (0xb7f4d000)
        ./vstdlib_i486.so => ./vstdlib_i486.so (0xb7f39000)
        libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7e0c000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
        libz.so.1 => /usr/lib/libz.so.1 (0xb7dfb000)
        libcrypt.so.1 => /lib/tls/i686/cmov/libcrypt.so.1 (0xb7dcd000)
        libnsl.so.1 => /lib/tls/i686/cmov/libnsl.so.1 (0xb7db9000)
        tier0_i486.so => not found
undefined symbol: _Z12MathLib_Initfffibbbb      (./maitredede_plugin_i486.so)
undefined symbol: _Z10Bot_RunAllv       (./maitredede_plugin_i486.so)
There is twice the file tier0_i486.so that is found only one time. Grrr...

Any idea please ? May I have forgotten to include one file in my cpp ?
__________________
make brain && make install
maitredede is offline
chrishx3000
Member
Join Date: Nov 2004
Location: Sweden
Old 07-12-2005 , 02:13  
Reply With Quote #13

Quote:
Originally Posted by maitredede
Ok, found the reason : the dir where gcc search the .so files but a strange thing... Here is the ldd :
Code:
root@server:/usr/src/half-life/myplugin # ldd -d maitredede_plugin_i486.so
                libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7fbe000)
        libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7fbb000)
        ./tier0_i486.so => ./tier0_i486.so (0xb7f8a000)
        libmysqlclient.so.12 => /usr/lib/libmysqlclient.so.12 (0xb7f4d000)
        ./vstdlib_i486.so => ./vstdlib_i486.so (0xb7f39000)
        libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7e0c000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
        libz.so.1 => /usr/lib/libz.so.1 (0xb7dfb000)
        libcrypt.so.1 => /lib/tls/i686/cmov/libcrypt.so.1 (0xb7dcd000)
        libnsl.so.1 => /lib/tls/i686/cmov/libnsl.so.1 (0xb7db9000)
        tier0_i486.so => not found
undefined symbol: _Z12MathLib_Initfffibbbb      (./maitredede_plugin_i486.so)
undefined symbol: _Z10Bot_RunAllv       (./maitredede_plugin_i486.so)
There is twice the file tier0_i486.so that is found only one time. Grrr...

Any idea please ? May I have forgotten to include one file in my cpp ?
Yes, you forgot to include some header files (.h files) when you compiled. This is not in the .cpp file but in your Makefile. The Makefile are missing the header files containing MathLib_Init and Bot_RunAll I believe.

/Chris
chrishx3000 is offline
maitredede
Senior Member
Join Date: May 2005
Old 07-12-2005 , 03:22  
Reply With Quote #14

yepee, a post ;)

I think so...

I've included the mathlib.cpp in the files to compile (which defines Mathlib_Init), included mathlib.h in my source, and no more undefinied symobl. But still a 'not found' :
Code:
root@server:/usr/src/half-life/maitredede_plugin # ldd -d maitredede_plugin_i486.so
                libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7fa8000)
        libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7fa5000)
        ./tier0_i486.so => ./tier0_i486.so (0xb7f74000)
        libmysqlclient.so.12 => /usr/lib/libmysqlclient.so.12 (0xb7f37000)
        ./vstdlib_i486.so => ./vstdlib_i486.so (0xb7f23000)
        tier0_i486.so => not found
        libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7df6000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
        libz.so.1 => /usr/lib/libz.so.1 (0xb7de4000)
        libcrypt.so.1 => /lib/tls/i686/cmov/libcrypt.so.1 (0xb7db7000)
        libnsl.so.1 => /lib/tls/i686/cmov/libnsl.so.1 (0xb7da3000)
        tier0_i486.so => not found
maitredede is offline
maitredede
Senior Member
Join Date: May 2005
Old 07-12-2005 , 04:32  
Reply With Quote #15

OK,

Since I have only problems, I have made this :
- clean install of my distrib (Ubuntu hoary)
- installation of all necessary files
from http://developer.valvesoftware.com/w...ng_under_Linux
- installation of SDK, and my cpp files
using http://forums.alliedmods.net/showthread.php?t=36888
- configuration of the makefile from link above...

I try to compile the serveplugin_empty...

The lines I have changed in the makefile :
Code:
CPLUS=g++-3.4
CLINK=gcc-3.4
CPP_LIB=/usr/lib/gcc/i486-linux/3.4.4/libstdc++.a \
        /usr/lib/gcc/i486-linux/3.4.4/libgcc_eh.a \
to reflect my distrib...

First compilation :
Code:
root@vmubuntu:/usr/src/half-life/serverplugin_empty # ldd serverplugin_empty_i486.so
                libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7fb3000)
        libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7fb0000)
        tier0_i486.so => not found
        vstdlib_i486.so => not found
        libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7e82000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
I changed this line :
Code:
LDFLAGS=-lm -ldl tier0_i486.so vstdlib_i486.so ./tier0_i486.so ./vstdlib_i486.so
Second compilation :
Code:
root@vmubuntu:/usr/src/half-life/serverplugin_empty # ldd -d serverplugin_empty_i486.so
                libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7fb3000)
        libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7fb0000)
        tier0_i486.so => not found
        vstdlib_i486.so => not found
        ./tier0_i486.so => ./tier0_i486.so (0xb7f7f000)
        ./vstdlib_i486.so => ./vstdlib_i486.so (0xb7f6b000)
        libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7e3e000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
        tier0_i486.so => not found
undefined symbol: _Z12MathLib_Initfffibbbb      (./serverplugin_empty_i486.so)
undefined symbol: _Z10Bot_RunAllv       (./serverplugin_empty_i486.so)
What did I do wrong ?[/code]
maitredede is offline
chrishx3000
Member
Join Date: Nov 2004
Location: Sweden
Old 07-12-2005 , 09:37  
Reply With Quote #16

I don't think you should edit the line, change it from:
Code:
LDFLAGS=-lm -ldl tier0_i486.so vstdlib_i486.so ./tier0_i486.so ./vstdlib_i486.so
to (what it used to say):
Code:
LDFLAGS=-lm -ldl tier0_i486.so vstdlib_i486.so
Make sure the line (in your Makefile):
Code:
HL2BIN_DIR=../hl2sdk/valve/hl2bin/bin
points to an existing directory which contains the HL2 bin. Easiest way to check is to do:
Code:
cd ../hl2sdk/valve/hl2bin/bin
from the directory where the Makefile is.

Also, could you please post the lines (from your Makefile) between:
Code:
#############################################################################
# Developer configurable items
#############################################################################
and
Code:
#############################################################################
# Things below here shouldn't need to be altered
#############################################################################
/Chris
chrishx3000 is offline
maitredede
Senior Member
Join Date: May 2005
Old 07-15-2005 , 03:03  
Reply With Quote #17

Here is my complete makefile :
Code:
#############################################################################
# Developer configurable items
#############################################################################

# the name of the plugin binary after its compiled (_i486.so is appended to the end)
NAME=serverplugin_empty

# source files that should be compiled and linked into the binary
SRC_FILES = serverplugin_empty.cpp serverplugin_convar.cpp
#SRC_FILES = maitredede_plugin.cpp serverplugin_convar.cpp serverplugin_bot.cpp

# the location of the SDK source code
HL2SDK_SRC_DIR=../hl2sdk/src_mod

# the directory the base binaries (tier0_i486.so, etc) are located
#HL2BIN_DIR=../valve/hl2bin/bin
#HL2BIN_DIR=/usr/src/half-life/valve/hl2bin/bin
HL2BIN_DIR=/home/hlds/source/bin

# compiler options (gcc 3.4.1 or above is required)
# to find the location for the CPP_LIB files use "updatedb" then "locate libstdc++.a"
CPLUS=g++-3.4
CLINK=gcc

#CPP_LIB=/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/libstdc++.a \
#	/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/libgcc_eh.a \
CPP_LIB=/usr/lib/gcc/i486-linux/3.4.4/libstdc++.a /usr/lib/gcc/i486-linux/3.4.4/64/libgcc.a

# put any compiler flags you want passed here
USER_CFLAGS=

# link flags for your mod, make sure to include any special libraries here
#LDFLAGS=-lm -ldl libmysqlclient.so tier0_i486.so vstdlib_i486.so
LDFLAGS=-lm -ldl tier0_i486.so vstdlib_i486.so
#LDFLAGS=-L . -lm -ldl ./tier0_i486.so libmysqlclient.so ./vstdlib_i486.so

#############################################################################
# Things below here shouldn't need to be altered
#############################################################################

# dirs for source code
PLUGIN_SRC_DIR=.
PUBLIC_SRC_DIR=$(HL2SDK_SRC_DIR)/public
TIER0_PUBLIC_SRC_DIR=$(HL2SDK_SRC_DIR)/public/tier0
TIER1_SRC_DIR=$(HL2SDK_SRC_DIR)/tier1

# the dir we want to put binaries we build into
BUILD_DIR=.

# the place to put object files
BUILD_OBJ_DIR=$(BUILD_DIR)/obj
PLUGIN_OBJ_DIR=$(BUILD_OBJ_DIR)
PUBLIC_OBJ_DIR=$(BUILD_OBJ_DIR)/public
TIER0_OBJ_DIR=$(BUILD_OBJ_DIR)/tier0
TIER1_OBJ_DIR=$(BUILD_OBJ_DIR)/tier1

# the CPU target for the build, must be i486 for now
ARCH=i486
ARCH_CFLAGS=-march=pentium -mmmx -O3

# -fpermissive is so gcc 3.4.x doesn't complain about some template stuff
BASE_CFLAGS=-fpermissive -D_LINUX -DNDEBUG -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp
SHLIBEXT=so
SHLIBLDFLAGS=-shared

CFLAGS=$(USER_CFLAGS) $(BASE_CFLAGS) $(ARCH_CFLAGS)
#DEBUG=-g -ggdb
#CFLAGS+= $(DEBUG)

INCLUDEDIRS=-I$(PUBLIC_SRC_DIR) -I$(PUBLIC_SRC_DIR)/tier1 -I$(PUBLIC_SRC_DIR)/engine -I$(PUBLIC_SRC_DIR)/dlls  -I$(HL2SDK_SRC_DIR)/game_shared -I$(HL2SDK_SRC_DIR)/common -I$(HL2SDK_SRC_DIR)/dlls -Dstrcmpi=strcasecmp -D_alloca=alloca -I/usr/include/mysql -I./

DO_CC=$(CPLUS) $(INCLUDEDIRS) -w $(CFLAGS) -DARCH=$(ARCH) -o $@ -c $<

#####################################################################

PLUGIN_OBJS := $(SRC_FILES:%.cpp=$(PLUGIN_OBJ_DIR)/%.o)

PUBLIC_OBJS = \

TIER1_OBJS = \
	$(TIER1_OBJ_DIR)/convar.o \
	$(TIER1_OBJ_DIR)/interface.o \
	$(TIER1_OBJ_DIR)/KeyValues.o \
	$(TIER1_OBJ_DIR)/utlbuffer.o \

TIER0_OBJS = \
	$(TIER0_OBJ_DIR)/memoverride.o \

all: dirs $(NAME)_$(ARCH).$(SHLIBEXT)

dirs:
	@if [ ! -f "tier0_i486.so" ]; then ln -s $(HL2BIN_DIR)/tier0_i486.so .; fi
	@if [ ! -f "vstdlib_i486.so" ]; then ln -s $(HL2BIN_DIR)/vstdlib_i486.so .; fi
	@if [ ! -d $(BUILD_DIR) ]; then mkdir $(BUILD_DIR); fi
	@if [ ! -d $(BUILD_OBJ_DIR) ]; then mkdir $(BUILD_OBJ_DIR); fi
	@if [ ! -d $(PLUGIN_OBJ_DIR) ]; then mkdir $(PLUGIN_OBJ_DIR); fi
	@if [ ! -d $(PUBLIC_OBJ_DIR) ]; then mkdir $(PUBLIC_OBJ_DIR); fi
	@if [ ! -d $(TIER0_OBJ_DIR) ]; then mkdir $(TIER0_OBJ_DIR); fi
	@if [ ! -d $(TIER1_OBJ_DIR) ]; then mkdir $(TIER1_OBJ_DIR); fi


$(NAME)_$(ARCH).$(SHLIBEXT): $(PLUGIN_OBJS) $(PUBLIC_OBJS) $(TIER0_OBJS) $(TIER1_OBJS)
	$(CLINK) $(DEBUG) -o $(BUILD_DIR)/$@ $(SHLIBLDFLAGS) $(PLUGIN_OBJS) $(PUBLIC_OBJS) $(TIER0_OBJS) $(TIER1_OBJS) $(CPP_LIB) $(LDFLAGS)

$(PLUGIN_OBJ_DIR)/%.o: $(PLUGIN_SRC_DIR)/%.cpp
	$(DO_CC)

$(PUBLIC_OBJ_DIR)/%.o: $(PUBLIC_SRC_DIR)/%.cpp
	$(DO_CC)

$(TIER0_OBJ_DIR)/%.o: $(TIER0_PUBLIC_SRC_DIR)/%.cpp
	$(DO_CC)

$(TIER1_OBJ_DIR)/%.o: $(TIER1_SRC_DIR)/%.cpp
	$(DO_CC)

clean:
	-rm -Rf $(PLUGIN_OBJ_DIR)
	-rm -f $(NAME)_$(ARCH).$(SHLIBEXT) tier0_i486.so vstdlib_i486.so
__________________
make brain && make install
maitredede is offline
chrishx3000
Member
Join Date: Nov 2004
Location: Sweden
Old 07-26-2005 , 07:31  
Reply With Quote #18

Sorry for being away.

Are you sure the path
Code:
HL2BIN_DIR=/home/hlds/source/bin
exists?

/Chris
chrishx3000 is offline
maitredede
Senior Member
Join Date: May 2005
Old 08-01-2005 , 05:24  
Reply With Quote #19

Quote:
Originally Posted by chrishx3000
Are you sure the path
Code:
HL2BIN_DIR=/home/hlds/source/bin
exists?
I'm not sure, I'll check...
Is this path needed just for compilation, or always ?
__________________
make brain && make install
maitredede is offline
maitredede
Senior Member
Join Date: May 2005
Old 08-02-2005 , 02:58  
Reply With Quote #20

HAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAA

I'm really so stupid !!!
I MAY HIT MYSELF, AND THROW MYSELF A GRENADE !!!

Just missing :
Code:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.
I've made a simple script :
Code:
#!/bin/sh
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.
make clean
make
And it works... At 7:57am, just before going to work...

A plugin_print :
Code:
Loaded plugins:
---------------------
0:      "MaitreDede's Plugin"
---------------------
But anyway, thanks for your help
__________________
make brain && make install
maitredede is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 06:31.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode