Linux Linking Problem With A Hlmod
anybody
Join Date: 2003-03-23 Member: 14803Members
I compiled the linux dll for the upcoming 3.0 release from wormshl(www.wormshl.com). When I'm running my compiled dll on other boxes I get an error. It's linked against my glibc version and won't work with other glibc version. I'm remembering you had the same problem with the first NS version as well. Could you please tell me how you fixed it?
I attached the Makefile and the hlds output:
TIA
anybody
[anybody@borg hlds_l]$ ./hlds_run -game wormshl +port 27016
Auto-restarting the server on crash
Host_Init
Added packfile /home/anybody/wormshl/hlds_l/valve/pak0.pak (985 files)
Protocol version 46
Exe version 3.1.1.0
Exe build: 14:46:34 Jun 11 2002 (2056)
WON Auth Server
couldn't exec language.cfg
Server IP address 62.159.211.134:27016
LoadLibrary failed on /home/anybody/wormshl/hlds_l/wormshl/dlls/wormshl_i386.so: /lib/libc.so.6: version `GLIBC_2.3' not found (required by /home/anybody/wormshl/hlds_l/wormshl/dlls/wormshl_i386.so)
Host_Error: Couldn't get DLL API from /home/anybody/wormshl/hlds_l/wormshl/dlls/wormshl_i386.so!
FATAL ERROR (shutting down): Host_Error: Couldn't get DLL API from /home/anybody/wormshl/hlds_l/wormshl/dlls/wormshl_i386.so!
The MakeFile:
DLLNAME=wormshl
ARCH=i386
#make sure this is the correct compiler for your system
CC=gcc-2.91.66
DLL_SRCDIR=.
WPN_SHARED_SRCDIR=./wpn_shared
PM_SHARED_SRCDIR=../pm_shared
DLL_OBJDIR=$(DLL_SRCDIR)/obj
WPN_SHARED_OBJDIR=$(WPN_SHARED_SRCDIR)/obj
PM_SHARED_OBJDIR=$(PM_SHARED_SRCDIR)/obj
BASE_CFLAGS=-lm -Dstricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp
#safe optimization
CFLAGS=$(BASE_CFLAGS) -w -m486 -O1
#use these when debugging
CFLAGS=$(BASE_CFLAGS) -g
INCLUDEDIRS=-I. -I../engine -I../common -I../pm_shared
LDFLAGS=
SHLIBEXT=so
SHLIBCFLAGS=-fPIC
SHLIBLDFLAGS=-shared
DO_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) $(INCLUDEDIRS) -o $@ -c $<
$(DLL_OBJDIR)/%.o: $(DLL_SRCDIR)/%.cpp
$(DO_CC)
$(WPN_SHARED_OBJDIR)/%.o: $(WPN_SHARED_SRCDIR)/%.cpp
$(DO_CC)
$(PM_SHARED_OBJDIR)/%.o: $(PM_SHARED_SRCDIR)/%.c
$(DO_CC)
OBJ = \
$(DLL_OBJDIR)/animating.o \
some more objects
$(PM_SHARED_OBJDIR)/pm_shared.o
$(DLLNAME)_$(ARCH).$(SHLIBEXT) : neat $(OBJ)
$(CC) $(CFLAGS) $(SHLIBLDFLAGS) $(LDFLAGS) -o $@ $(OBJ)
neat:
-mkdir $(DLL_OBJDIR)
-mkdir $(WPN_SHARED_OBJDIR)
-mkdir $(PM_SHARED_OBJDIR)
clean:
-rm -f $(OBJ)
-rm -f $(DLLNAME)_$(ARCH).$(SHLIBEXT)
spotless: clean
-rm -r $(DLL_OBJDIR)
-rm -r $(WPN_SHARED_OBJDIR)
-rm -r $(PM_SHARED_OBJDIR)
I attached the Makefile and the hlds output:
TIA
anybody
[anybody@borg hlds_l]$ ./hlds_run -game wormshl +port 27016
Auto-restarting the server on crash
Host_Init
Added packfile /home/anybody/wormshl/hlds_l/valve/pak0.pak (985 files)
Protocol version 46
Exe version 3.1.1.0
Exe build: 14:46:34 Jun 11 2002 (2056)
WON Auth Server
couldn't exec language.cfg
Server IP address 62.159.211.134:27016
LoadLibrary failed on /home/anybody/wormshl/hlds_l/wormshl/dlls/wormshl_i386.so: /lib/libc.so.6: version `GLIBC_2.3' not found (required by /home/anybody/wormshl/hlds_l/wormshl/dlls/wormshl_i386.so)
Host_Error: Couldn't get DLL API from /home/anybody/wormshl/hlds_l/wormshl/dlls/wormshl_i386.so!
FATAL ERROR (shutting down): Host_Error: Couldn't get DLL API from /home/anybody/wormshl/hlds_l/wormshl/dlls/wormshl_i386.so!
The MakeFile:
DLLNAME=wormshl
ARCH=i386
#make sure this is the correct compiler for your system
CC=gcc-2.91.66
DLL_SRCDIR=.
WPN_SHARED_SRCDIR=./wpn_shared
PM_SHARED_SRCDIR=../pm_shared
DLL_OBJDIR=$(DLL_SRCDIR)/obj
WPN_SHARED_OBJDIR=$(WPN_SHARED_SRCDIR)/obj
PM_SHARED_OBJDIR=$(PM_SHARED_SRCDIR)/obj
BASE_CFLAGS=-lm -Dstricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp
#safe optimization
CFLAGS=$(BASE_CFLAGS) -w -m486 -O1
#use these when debugging
CFLAGS=$(BASE_CFLAGS) -g
INCLUDEDIRS=-I. -I../engine -I../common -I../pm_shared
LDFLAGS=
SHLIBEXT=so
SHLIBCFLAGS=-fPIC
SHLIBLDFLAGS=-shared
DO_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) $(INCLUDEDIRS) -o $@ -c $<
$(DLL_OBJDIR)/%.o: $(DLL_SRCDIR)/%.cpp
$(DO_CC)
$(WPN_SHARED_OBJDIR)/%.o: $(WPN_SHARED_SRCDIR)/%.cpp
$(DO_CC)
$(PM_SHARED_OBJDIR)/%.o: $(PM_SHARED_SRCDIR)/%.c
$(DO_CC)
OBJ = \
$(DLL_OBJDIR)/animating.o \
some more objects
$(PM_SHARED_OBJDIR)/pm_shared.o
$(DLLNAME)_$(ARCH).$(SHLIBEXT) : neat $(OBJ)
$(CC) $(CFLAGS) $(SHLIBLDFLAGS) $(LDFLAGS) -o $@ $(OBJ)
neat:
-mkdir $(DLL_OBJDIR)
-mkdir $(WPN_SHARED_OBJDIR)
-mkdir $(PM_SHARED_OBJDIR)
clean:
-rm -f $(OBJ)
-rm -f $(DLLNAME)_$(ARCH).$(SHLIBEXT)
spotless: clean
-rm -r $(DLL_OBJDIR)
-rm -r $(WPN_SHARED_OBJDIR)
-rm -r $(PM_SHARED_OBJDIR)
Comments
(And wouldn't this better belong in the 'servers and server operators' forum?)
Regards
anybody
SHLIBCFLAGS=-fPIC
SHLIBLDFLAGS=-shared
i tried to play around with these
e.g. set it to -static instead of -shared, but then i didn't compile
Regards
anybody
You need to install a copy of the older glibc, and force your compiler/linker to use that version. This can be tricky; search the web for comprehensive guides on doing this. The procedure is basically that of cross-compiling for another platform. A simpler solution would be to obtain access to a machine with the older libs, and compile your mod there.