Raised This Month: $51 Target: $400
 12% 

Error when compiling under Linux


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MC_RaT
New Member
Join Date: Dec 2005
Old 12-21-2005 , 09:47   Error when compiling under Linux
Reply With Quote #1

Hello; i try to compile the source code under linux; but i have some errors.

I have installed all packages and programs we need to compile; and try to configure the makefile.

This is the makefile ( 41 firsts lines)
Code:
# the name of the mod binary (_i486.so is appended to the end)
NAME=server
# the location of the vcproj that builds the mod
MOD_PROJ=../dlls/hl_sdk.vcproj
# the name of the mod configuration (typically <proj name>_<build type><build target>)
MOD_CONFIG=hl_ReleaseSDKWin32

# the directory the base binaries (tier0_i486.so, etc) are located
GAME_DIR=../../
#GAME_DIR=~/valve/hl2bin/

# compiler options (gcc 3.4.1 or above is required)
CC=/usr/bin/gcc
CPLUS=/usr/bin/g++
CLINK=/usr/bin/gcc
CPP_LIB="/usr/lib/libstdc++.a /usr/lib/gcc/i586-suse-linux/4.0.2/libgcc_eh.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 $(GAME_DIR)/bin/tier0_i486.so $(GAME_DIR)/bin/vstdlib_i486.so"

# XERCES 2.6.0 or above ( http://xml.apache.org/xerces-c/ ) is used by the vcproj to makefile converter
# it must be installed before being able to run this makefile
XERCES_INC_DIR=/home/dierick/xml/include
XERCES_LIB_DIR=/home/dierick/xml/lib
# if you have xerces installed already you should be able to use the two lines below
#XERCES_INC_DIR=/usr/include
#XERCES_LIB_DIR=/usr/lib

export LD_LIBRARY_PATH=.
For "GAME_DIR" i don't understand what it is.
HlČ must be installed on linux ??

And this is the makefile.vcpm
Code:
#
# VCProject file to Makefile converter
#
# November 2004, [email protected]
#

VCPM_SRC_DIR=$(SOURCE_DIR)/utils/vprojtomake
UTIL_COMMON_SRC_DIR=$(SOURCE_DIR)/utils/common
TIER1_PUBLIC_SRC_DIR=$(SOURCE_DIR)/public/tier1
PUBLIC_SRC_DIR=$(SOURCE_DIR)/public
TIER1_SRC_DIR=$(SOURCE_DIR)/tier1
TIER1_OBJ_DIR=$(BUILD_OBJ_DIR)/vcpm/public

VCPM_OBJ_DIR=$(BUILD_OBJ_DIR)/vcpm
TIER1_OBJ_DIR=$(BUILD_OBJ_DIR)/vcpm/public

#we use custome CFLAGS because the base ones interfere with XERCES
CFLAGS= -w -fpermissive -D_LINUX -DNDEBUG -D_alloca=alloca -D_snprintf=snprintf -D_vsnprintf=vsnprintf $(ARCH_CFLAGS)
#DEBUG = -g -ggdb
#CFLAGS+= $(DEBUG)

INCLUDEDIRS=-I$(PUBLIC_SRC_DIR) -I$(XERCES_INC_DIR) -I$(UTIL_COMMON_SRC_DIR) -I$(TIER1_PUBLIC_SRC_DIR)
LDFLAGS_VC=-lm -ldl -L$(XERCES_LIB_DIR) -lxerces-c $(GAME_DIR)/bin/tier0_i486.so $(GAME_DIR)/bin/vstdlib_i486.so

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

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

VCPM_OBJS = \
	$(VCPM_OBJ_DIR)/makefilecreator.o \
	$(VCPM_OBJ_DIR)/vprojtomake.o \
	$(VCPM_OBJ_DIR)/vcprojconvert.o \

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

all: dirs vcpm

dirs:
	-mkdir $(BUILD_OBJ_DIR)
	-mkdir $(VCPM_OBJ_DIR)
	-mkdir $(TIER1_OBJ_DIR)

vcpm: $(VCPM_OBJS) $(TIER1_OBJS)
	$(CLINK) $(DEBUG) -o $(BUILD_DIR)/$@ $(VCPM_OBJS) $(TIER1_OBJS) $(CPP_LIB) $(LDFLAGS_VC)

$(VCPM_OBJ_DIR)/%.o: $(VCPM_SRC_DIR)/%.cpp
	$(DO_CC)

$(TIER1_OBJ_DIR)/%.o: $(TIER1_SRC_DIR)/%.cpp
	$(DO_CC) -Dstricmp=strcasecmp -Dstrcmpi=strcasecmp

clean:
	-rm -rf $(VCPM_OBJ_DIR)
	-rm -f vcpm
I've try to modify the lines same as the HLČ Wiki website but i don't understand exactly what we must change.

When i tape "make" in the linux_sdk path; it's run the makefile:
Code:
if [ -z "/usr/bin/gcc" ]; then echo "Compiler not defined."; exit; fi
if [ ! -d . ];then mkdir .;fi
cd .
make -f Makefile.vcpm CC=/usr/bin/gcc CPLUS=/usr/bin/g++ CPP_LIB="/usr/lib/libstdc++.a /usr/lib/gcc/i586-suse-linux/4.0.2/libgcc_eh.a" BUILD_DIR=. BUILD_OBJ_DIR=./obj SOURCE_DIR=.. SHLIBLDFLAGS=-shared -Wl,-Map,vcpm_map.txt -Wl SHLIBEXT=so CLINK=/usr/bin/gcc CFLAGS="  -mtune=i686 -march=pentium -mmmx -O3 -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 -Usprintf=use_Q_snprintf_instead_of_sprintf -Ustrncpy=use_Q_strncpy_instead -UPROTECTED_THINGS_ENABLE" LDFLAGS="-lm -ldl ./bin/tier0_i486.so ./bin/vstdlib_i486.so" ARCH=i486 GAME_DIR=. MOD_CONFIG=hl_ReleaseSDKWin32 NAME=server XERCES_INC_DIR=/home/dierick/xml/include XERCES_LIB_DIR=/home/dierick/xml/lib
make[1]: Entering directory `/home/dierick/src/src/linux_sdk'
mkdir ./obj
mkdir ./obj/vcpm
mkdir ./obj/vcpm/public
/usr/bin/g++ -I../public -I/home/dierick/xml/include -I../utils/common -I../public/tier1 -w -mtune=i686 -march=pentium -mmmx -O3 -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 -Usprintf=use_Q_snprintf_instead_of_sprintf -Ustrncpy=use_Q_strncpy_instead -UPROTECTED_THINGS_ENABLE -DARCH=i486 -o obj/vcpm/makefilecreator.o -c ../utils/vprojtomake/makefilecreator.cpp
/usr/bin/g++ -I../public -I/home/dierick/xml/include -I../utils/common -I../public/tier1 -w -mtune=i686 -march=pentium -mmmx -O3 -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 -Usprintf=use_Q_snprintf_instead_of_sprintf -Ustrncpy=use_Q_strncpy_instead -UPROTECTED_THINGS_ENABLE -DARCH=i486 -o obj/vcpm/vprojtomake.o -c ../utils/vprojtomake/vprojtomake.cpp
/usr/bin/g++ -I../public -I/home/dierick/xml/include -I../utils/common -I../public/tier1 -w -mtune=i686 -march=pentium -mmmx -O3 -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 -Usprintf=use_Q_snprintf_instead_of_sprintf -Ustrncpy=use_Q_strncpy_instead -UPROTECTED_THINGS_ENABLE -DARCH=i486 -o obj/vcpm/vcprojconvert.o -c ../utils/vprojtomake/vcprojconvert.cpp
/usr/bin/g++ -I../public -I/home/dierick/xml/include -I../utils/common -I../public/tier1 -w -mtune=i686 -march=pentium -mmmx -O3 -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 -Usprintf=use_Q_snprintf_instead_of_sprintf -Ustrncpy=use_Q_strncpy_instead -UPROTECTED_THINGS_ENABLE -DARCH=i486 -o obj/vcpm/public/characterset.o -c ../tier1/characterset.cpp -Dstricmp=strcasecmp -Dstrcmpi=strcasecmp
/usr/bin/g++ -I../public -I/home/dierick/xml/include -I../utils/common -I../public/tier1 -w -mtune=i686 -march=pentium -mmmx -O3 -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 -Usprintf=use_Q_snprintf_instead_of_sprintf -Ustrncpy=use_Q_strncpy_instead -UPROTECTED_THINGS_ENABLE -DARCH=i486 -o obj/vcpm/public/interface.o -c ../tier1/interface.cpp -Dstricmp=strcasecmp -Dstrcmpi=strcasecmp
/usr/bin/g++ -I../public -I/home/dierick/xml/include -I../utils/common -I../public/tier1 -w -mtune=i686 -march=pentium -mmmx -O3 -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 -Usprintf=use_Q_snprintf_instead_of_sprintf -Ustrncpy=use_Q_strncpy_instead -UPROTECTED_THINGS_ENABLE -DARCH=i486 -o obj/vcpm/public/KeyValues.o -c ../tier1/KeyValues.cpp -Dstricmp=strcasecmp -Dstrcmpi=strcasecmp
/usr/bin/g++ -I../public -I/home/dierick/xml/include -I../utils/common -I../public/tier1 -w -mtune=i686 -march=pentium -mmmx -O3 -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 -Usprintf=use_Q_snprintf_instead_of_sprintf -Ustrncpy=use_Q_strncpy_instead -UPROTECTED_THINGS_ENABLE -DARCH=i486 -o obj/vcpm/public/utlbuffer.o -c ../tier1/utlbuffer.cpp -Dstricmp=strcasecmp -Dstrcmpi=strcasecmp
/usr/bin/g++ -I../public -I/home/dierick/xml/include -I../utils/common -I../public/tier1 -w -mtune=i686 -march=pentium -mmmx -O3 -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 -Usprintf=use_Q_snprintf_instead_of_sprintf -Ustrncpy=use_Q_strncpy_instead -UPROTECTED_THINGS_ENABLE -DARCH=i486 -o obj/vcpm/public/utlsymbol.o -c ../tier1/utlsymbol.cpp -Dstricmp=strcasecmp -Dstrcmpi=strcasecmp
/usr/bin/gcc  -o ./vcpm ./obj/vcpm/makefilecreator.o ./obj/vcpm/vprojtomake.o ./obj/vcpm/vcprojconvert.o  ./obj/vcpm/public/characterset.o ./obj/vcpm/public/interface.o ./obj/vcpm/public/KeyValues.o ./obj/vcpm/public/utlbuffer.o ./obj/vcpm/public/utlsymbol.o  /usr/lib/libstdc++.a /usr/lib/gcc/i586-suse-linux/4.0.2/libgcc_eh.a -lm -ldl -L/home/dierick/xml/lib -lxerces-c ./bin/tier0_i486.so ./bin/vstdlib_i486.so
make[1]: Leaving directory `/home/dierick/src/src/linux_sdk'
gcc: ../..//bin/tier0_i486.so: No such file or directory
gcc: ../..//bin/vstdlib_i486.so: No such file or directory
make[1]: *** [vcpm] Error 1
make[1]: Leaving directory `/home/dierick/src/src/linux_sdk'
make: *** [vcpm] Error 2


Can someone give me his makefile and makefile.vcpm ?

Please help me.

Thanks
MC_RaT is offline
showdax
Senior Member
Join Date: Dec 2004
Old 12-21-2005 , 12:54  
Reply With Quote #2

What are you even trying to do? If you're trying to compile a mod and you're asking for help on that, you've come to the wrong place. If you're trying to compile a plugin, maybe you should look around before posting. There's a thread that contains an easier-to-use makefile for server plugins in this very forum.

As for the "game dir", it's referring to an installation of the HL2 server software, which contains required libraries.
showdax is offline
Send a message via MSN to showdax
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 12-21-2005 , 13:00  
Reply With Quote #3

Quote:
Originally Posted by What he should have
I have some errors when I try and compile the linux sdk.
gcc: ../..//bin/tier0_i486.so: No such file or directory
gcc: ../..//bin/vstdlib_i486.so: No such file or directory
So, you need to change GAME_DIR to the location of the bin directory of a srcds_l installation.

You dont need the full install, just the bin folder ( not cstrike/bin, just srcds_l/bin )
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
MC_RaT
New Member
Join Date: Dec 2005
Old 12-21-2005 , 13:25  
Reply With Quote #4

yes i'm trying to compile a mod.

Sorry if it's not in the good forum.

Quote:
So, you need to change GAME_DIR to the location of the bin directory of a srcds_l installation.
where is "srcds_l " ?

i don't find any directory with this name.

Thanks for your answers
MC_RaT is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 12-21-2005 , 15:11  
Reply With Quote #5

c0ldfyr3's answer was for a server plugin.

This forum is devoted to coding server plugins using metamod:source. Most of the people here have never compiled a full mod. You should try the official VERC forums or perhaps the HL2Coding.com forums.
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke is offline
MC_RaT
New Member
Join Date: Dec 2005
Old 12-21-2005 , 19:01  
Reply With Quote #6

okay

i have tested other things, and now i have an error with libexerces-c.so.27

it said that it is not in the directory.

I have installed Xerces XML parser 2.6.0

i have read that we must export variables; but in the valve wiki it saids:
"export LD_LIBRARY_PATH=~/source/bin"

but what is the source/bin directory ??


Thanks;
MC_RaT is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 12-21-2005 , 21:09  
Reply With Quote #7

__________________
"Good grammar is essential, Robin."
- Batman
L. Duke 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:05.


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