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

Setting up linux environment:


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 06-23-2009 , 18:58   Setting up linux environment:
Reply With Quote #1

Hey, I'm trying to get into MM:S coding and I'm having trouble setting up the environment on linux and getting sample_mm.cpp to compile. I did get it setup on windows alright, but unfortunately, my server runs linux. Here's my situation:

I have gcc version 4.1.2.

I did not have the binary gcc-4.1, so I ran: sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.1 as per the documentation. gcc -v runs fine and reports the version above.

I have all the directories setup correctly. I made sure the paths at the top of the Makefile matched the ones that exist relative to the current folder.

Here's what happens when I run: make ENGINE=orangebox
Code:
if [ "true" = "false" ]; then \
                echo "You must supply ENGINE=left4dead or ENGINE=orangebox or ENGINE=original"; \
                exit 1; \
        fi
mkdir -p Release.orangebox
rm -f vstdlib_i486.so
rm -f tier0_i486.so
ln -sf ~/server/orangebox/bin/vstdlib_i486.so vstdlib_i486.so
ln -sf ~/server/orangebox/bin/tier0_i486.so tier0_i486.so
make -f Makefile sample_mm
make[1]: Entering directory `/home/steam/sdk/mmsource-1.7/sample_mm'
if [ "true" = "false" ]; then \
                echo "You must supply ENGINE=left4dead or ENGINE=orangebox or ENGINE=original"; \
                exit 1; \
        fi
gcc-4.1 -I../../hl2sdk-ob/public/game/server -I. -I.. -I../../hl2sdk-ob/public -I../../hl2sdk-ob/public/engine -I../../hl2sdk-ob/public/mathlib -I../../hl2sdk-ob/public/vstdlib -I../../hl2sdk-ob/public/tier0 -I../../hl2sdk-ob/public/tier1 -I. -I../mmsource-1.7/core -I../mmsource-1.7/core/sourcehook -DSOURCE_ENGINE=3 -DSE_EPISODEONE=1 -SE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_LEFT4DEAD=4 -O3 -funroll-loops -s -pipe -D_LINUX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Wno-non-virtual-dtor -Werror -fPIC -fno-exceptions -fno-rtti -msse -m32 -fno-strict-aliasing -fvisibility=hidden -fvisibility-inlines-hidden -o Release.orangebox/sample_mm.o -c sample_mm.cpp
gcc-4.1: unrecognized option '-SE_DARKMESSIAH=2'
In file included from sample_mm.cpp:18:
sample_mm.h:20:24: error: ISmmPlugin.h: No such file or directory
sample_mm.h:23:23: error: sh_vector.h: No such file or directory
../../hl2sdk-ob/public/game/server/iplayerinfo.h:155: error: âGetPlayerInfoâ declared as a âvirtualâ field
../../hl2sdk-ob/public/game/server/iplayerinfo.h:155: error: expected â;â before â(â token
../../hl2sdk-ob/public/game/server/iplayerinfo.h:156: error: ISO C++ forbids declaration of âCGlobalVarsâ with no type
../../hl2sdk-ob/public/game/server/iplayerinfo.h:156: error: âCGlobalVarsâ declared as a âvirtualâ field
../../hl2sdk-ob/public/game/server/iplayerinfo.h:156: error: expected â;â before â*â token
../../hl2sdk-ob/public/game/server/iplayerinfo.h:190: error: âGetBotControllerâ declared as a âvirtualâ field
../../hl2sdk-ob/public/game/server/iplayerinfo.h:190: error: expected â;â before â(â token
../../hl2sdk-ob/public/game/server/iplayerinfo.h:192: error: ISO C++ forbids declaration of âedict_tâ with no type
../../hl2sdk-ob/public/game/server/iplayerinfo.h:192: error: âedict_tâ declared as a âvirtualâ field
../../hl2sdk-ob/public/game/server/iplayerinfo.h:192: error: expected â;â before â*â token
sample_mm.h:30: error: expected class-name before â,â token
sample_mm.h:31: error: expected class-name before â{â token
sample_mm.h:33: error: âPluginIdâ has not been declared
sample_mm.h:33: error: âISmmAPIâ has not been declared
sample_mm.h:76: error: âSourceHookâ has not been declared
sample_mm.h:76: error: ISO C++ forbids declaration of âCallClassâ with no type
sample_mm.h:76: error: expected â;â before â<â token
sample_mm.h:82: error: expected constructor, destructor, or type conversion before â;â token
sample_mm.cpp:20: error: âLevelInitâ has not been declared
sample_mm.cpp:20: error: âSH_NOATTRIBâ has not been declared
sample_mm.cpp:20: error: expected identifier before numeric constant
sample_mm.cpp:20: error: expected â,â or â...â before numeric constant
sample_mm.cpp:20: error: expected constructor, destructor, or type conversion before â;â token
sample_mm.cpp:21: error: âServerActivateâ has not been declared
sample_mm.cpp:21: error: âSH_NOATTRIBâ has not been declared
sample_mm.cpp:21: error: expected identifier before numeric constant
sample_mm.cpp:21: error: expected â,â or â...â before numeric constant
sample_mm.cpp:21: error: expected constructor, destructor, or type conversion before â;â token
sample_mm.cpp:22: error: âGameFrameâ has not been declared
sample_mm.cpp:22: error: âSH_NOATTRIBâ has not been declared
sample_mm.cpp:22: error: expected identifier before numeric constant
sample_mm.cpp:22: error: expected â,â or â...â before numeric constant
sample_mm.cpp:22: error: expected constructor, destructor, or type conversion before â;â token
sample_mm.cpp:23: error: âLevelShutdownâ has not been declared
sample_mm.cpp:23: error: âSH_NOATTRIBâ has not been declared
sample_mm.cpp:23: error: expected identifier before numeric constant
sample_mm.cpp:23: error: expected â,â or â...â before numeric constant
sample_mm.cpp:23: error: expected constructor, destructor, or type conversion before â;â token
sample_mm.cpp:24: error: âClientActiveâ has not been declared
sample_mm.cpp:24: error: âSH_NOATTRIBâ has not been declared
sample_mm.cpp:24: error: expected identifier before numeric constant
sample_mm.cpp:24: error: expected â,â or â...â before numeric constant
sample_mm.cpp:24: error: expected constructor, destructor, or type conversion before â;â token
sample_mm.cpp:25: error: âClientDisconnectâ has not been declared
sample_mm.cpp:25: error: âSH_NOATTRIBâ has not been declared
sample_mm.cpp:25: error: expected identifier before numeric constant
sample_mm.cpp:25: error: expected â,â or â...â before numeric constant
sample_mm.cpp:25: error: expected constructor, destructor, or type conversion before â;â token
sample_mm.cpp:26: error: âClientPutInServerâ has not been declared
sample_mm.cpp:26: error: âSH_NOATTRIBâ has not been declared
sample_mm.cpp:26: error: expected identifier before numeric constant
sample_mm.cpp:26: error: expected â,â or â...â before numeric constant
sample_mm.cpp:26: error: expected constructor, destructor, or type conversion before â;â token
sample_mm.cpp:27: error: âSetCommandClientâ has not been declared
sample_mm.cpp:27: error: âSH_NOATTRIBâ has not been declared
sample_mm.cpp:27: error: expected identifier before numeric constant
sample_mm.cpp:27: error: expected â,â or â...â before numeric constant
sample_mm.cpp:27: error: expected constructor, destructor, or type conversion before â;â token
sample_mm.cpp:28: error: âClientSettingsChangedâ has not been declared
sample_mm.cpp:28: error: âSH_NOATTRIBâ has not been declared
sample_mm.cpp:28: error: expected identifier before numeric constant
sample_mm.cpp:28: error: expected â,â or â...â before numeric constant
sample_mm.cpp:28: error: expected constructor, destructor, or type conversion before â;â token
sample_mm.cpp:29: error: âClientConnectâ has not been declared
sample_mm.cpp:29: error: âSH_NOATTRIBâ has not been declared
sample_mm.cpp:29: error: expected identifier before numeric constant
sample_mm.cpp:29: error: expected â,â or â...â before numeric constant
sample_mm.cpp:29: error: expected constructor, destructor, or type conversion before â;â token
sample_mm.cpp:30: error: âFireEventâ has not been declared
sample_mm.cpp:30: error: âSH_NOATTRIBâ has not been declared
sample_mm.cpp:30: error: expected identifier before numeric constant
sample_mm.cpp:30: error: expected â,â or â...â before numeric constant
sample_mm.cpp:30: error: expected constructor, destructor, or type conversion before â;â token
sample_mm.cpp:33: error: âNetworkIDValidatedâ has not been declared
sample_mm.cpp:33: error: âSH_NOATTRIBâ has not been declared
sample_mm.cpp:33: error: expected identifier before numeric constant
sample_mm.cpp:33: error: expected â,â or â...â before numeric constant
sample_mm.cpp:33: error: expected constructor, destructor, or type conversion before â;â token
sample_mm.cpp:34: error: âClientCommandâ has not been declared
sample_mm.cpp:34: error: âSH_NOATTRIBâ has not been declared
sample_mm.cpp:34: error: expected identifier before numeric constant
sample_mm.cpp:34: error: expected â,â or â...â before numeric constant
sample_mm.cpp:34: error: expected constructor, destructor, or type conversion before â;â token
sample_mm.cpp: In member function âvirtual bool BaseAccessor::RegisterConCommandBase(ConCommandBase*)â:
sample_mm.cpp:61: error: âMETA_REGCVARâ was not declared in this scope
sample_mm.cpp: At global scope:
sample_mm.cpp:65: error: âg_SamplePluginâ is not a type
sample_mm.cpp:65: error: expected constructor, destructor, or type conversion before â;â token
sample_mm.cpp:66: error: âbool SamplePlugin::Loadâ is not a static member of âclass SamplePluginâ
sample_mm.cpp:66: error: âPluginIdâ was not declared in this scope
sample_mm.cpp:66: error: âISmmAPIâ was not declared in this scope
sample_mm.cpp:66: error: âismmâ was not declared in this scope
sample_mm.cpp:66: error: expected primary-expression before âcharâ
sample_mm.cpp:66: error: expected primary-expression before âmaxlenâ
sample_mm.cpp:66: error: expected primary-expression before âboolâ
sample_mm.cpp:66: error: initializer expression list treated as compound expression
sample_mm.cpp:67: error: expected â,â or â;â before â{â token
make[1]: *** [Release.orangebox/sample_mm.o] Error 1
make[1]: Leaving directory `/home/steam/sdk/mmsource-1.7/sample_mm'
make: *** [all] Error 2
It's likely that if I didn't mention something, it means I probably didn't do it. So if you think I failed to do something please let me know. I'm baffled right now. :/
__________________
pheadxdll is offline
Keeper
Senior Member
Join Date: Nov 2006
Old 06-23-2009 , 21:53   Re: Setting up linux environment:
Reply With Quote #2

It looks like some of the include directories aren't defined correctly for the sourcehook and SourceMM source files.

Also, change the
-SE_DARKMESSIAH=2 to -DSE_DARKMESSIAH=2
Keeper is offline
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 06-24-2009 , 00:39   Re: Setting up linux environment:
Reply With Quote #3

You were dead on, the directory that metamod was defined was incorrect. Thanks, fixed and compiling without errors - beautiful.
__________________
pheadxdll 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 09:32.


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