Linux Linking Problem With A Hlmod

anybodyanybody 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)

Comments

  • TalesinTalesin Our own little well of hate Join Date: 2002-11-08 Member: 7710NS1 Playtester, Forum Moderators
    Er.. take a closer look at the error? Looks like that module requires glibc 2.3 to compile, and either it isn't installed or wasn't found. Check your environment variable settings.
    (And wouldn't this better belong in the 'servers and server operators' forum?)
  • anybodyanybody Join Date: 2003-03-23 Member: 14803Members
    I compiled it on my homebox having a 2.3.1 installed. Most servers are running under 2.2.4 AFAIK. So I cannot release the server binary and I'm looking for a solution how I can compile it so that it will run with older glibc versions.

    Regards
    anybody
  • TalesinTalesin Our own little well of hate Join Date: 2002-11-08 Member: 7710NS1 Playtester, Forum Moderators
    Write/compile it with the older glibc installed. Otherwise, simply have it be that glibc 2.3.1 is required for compile/install. If you could release the compiled binary, you could simply set it to statically link within itself.. beyond that, the other systems just need to choose between updating their version of glibc, or not compiling/running it.
  • anybodyanybody Join Date: 2003-03-23 Member: 14803Members
    SHLIBEXT=so
    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
  • MonsieurEvilMonsieurEvil Join Date: 2002-01-22 Member: 4Members, Retired Developer, NS1 Playtester, Contributor
    ** Swoosh! Into the server forum it goes... **
  • verboseverbose Join Date: 2002-11-25 Member: 9968Members, Constellation
    <!--QuoteBegin--anybody+Mar 23 2003, 07:02 AM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (anybody @ Mar 23 2003, 07:02 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> I compiled it on my homebox having a 2.3.1 installed. Most servers are running under 2.2.4 AFAIK. So I cannot release the server binary and I'm looking for a solution how I can compile it so that it will run with older glibc versions. <!--QuoteEnd--> </td></tr></table><span class='postcolor'> <!--QuoteEEnd-->
    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.
Sign In or Register to comment.