Jump to content

SOLVED: Compiling the EF2 gamesource (linux)


  • You cannot reply to this topic

9 replies to this topic

#1 GSIO01

GSIO01

    UberGames Developer

  • UberGames Developer
  • 1,021 posts

Posted 17 May 2008 - 01:38 PM

I have been experimenting with the EF2 gamsource for some time now and have added some new commands to the game such as a beamTo command similar to RPG-X. Everything works fine when I compile and try it on windows.
Even as everything I have done so far works on windows it's useless as I can't compile the sourcecode on linux, which is a big problem because most dedicated servers are hosted on linuxservers.

After some failed attempts to get the EF2 gamesource to compile for linux (tried it on debian 4, suse 9.2 & 10.x), I thought I give it another try now.

This time on suse 9.3 and with no modifications to the gamecode at all. I was able to fix some major problems (depencies ...), but now I get folowing errors:

make
make targets B=releasei386-glibc CFLAGS="-Dstricmp=strcasecmp -Dstrcmpi=strcasecmp -Dstrnicmp=strncasecmp -pipe -DNDEBUG -O6 -march=pentium -fomit-frame-pointer -pipe -ffast-math -falign-loops=2 -falign-jumps=2 -falign-functions=2 -fno-strict-aliasing -fstrength-reduce -Wno-deprecated"
make[1]: Entering directory `/home/gsio01/ef2_gamesource/linux'
g++ -DGAME_DLL -DDEDICATED -DMISSIONPACK -DLINUX -Dstricmp=strcasecmp -Dstrcmpi=strcasecmp -Dstrnicmp=strncasecmp -pipe -DNDEBUG -O6 -march=pentium -fomit-frame-pointer -pipe -ffast-math -falign-loops=2 -falign-jumps=2 -falign-functions=2 -fno-strict-aliasing -fstrength-reduce -Wno-deprecated -fPIC -I../dlls -I../Shared -I../Executable -I../Shared/qcommon -I../Libs -o releasei386-glibc/game/changePosture.o -c ../dlls/game/changePosture.cpp
In file included from ../dlls/game/class.h:501,
from ../dlls/game/g_local.h:181,
from ../dlls/game/actor.h:31,
from ../dlls/game/changePosture.cpp:25:
../dlls/game/class.h: In constructor `SafePtr<T>::SafePtr(T*) [with T = Entity]
':
../dlls/game/archive.h:416: instantiated from here
../dlls/game/class.h:391: error: no matching function for call to `
SafePtr<Entity>::InitSafePtr(Entity*&)'
../dlls/game/class.h:339: error: candidates are: void
SafePtrBase::InitSafePtr(Class*)
make[1]: *** [releasei386-glibc/game/changePosture.o] Fehler 1
make[1]: Leaving directory `/home/gsio01/ef2_gamesource/linux'
make: *** [build_release] Fehler 2


Any ideas? I thought it might be a problem with the newer version of gcc/g++ as I don't think Ritual would have released the gamecode if there were problems compiling it on linux.

#2 TiM

TiM

    Administrator

  • UberGames Admin
  • 3,425 posts

Posted 21 May 2008 - 05:23 AM

Uhhhh..... I guess the resounding silence means no one knows. ^_^

Why do you have to compile it on a per OS basis? I'm guessing EF2 doesn't use the QVM method that Q3 does then...?

#3 GSIO01

GSIO01

    UberGames Developer

  • UberGames Developer
  • 1,021 posts

Posted 21 May 2008 - 12:07 PM

Right EF2 insn't using QVM method, what is quite bad as I have to get the damn code to compile on linux or cygwin.

I'll gona try to get hold of an older gcc/g++ version that was released in the year EF2 was released.

#4 Pollywog

Pollywog

    Member

  • Members
  • Pip
  • 4 posts

Posted 19 September 2008 - 05:27 AM

So were you eventually successful in compiling the source on Linux?
I assume it has to be compiled on the same system on which it will run.

#5 GSIO01

GSIO01

    UberGames Developer

  • UberGames Developer
  • 1,021 posts

Posted 21 October 2008 - 09:08 PM

Unfortunatly no success.

It does not have to be compiled on the same system it will run on, but compiling a linux binary on a linux system is easier than compiling it on a windows system.

I had to stop research for some time ... but I'm still going to try it in future.

#6 GSIO01

GSIO01

    UberGames Developer

  • UberGames Developer
  • 1,021 posts

Posted 22 October 2008 - 10:12 AM

Ok I just thought I'll sum up what I have done so far, just in case anyone is interested how to get at least this far when trying to compile the Source:

  • Download and unzip the Source Code or upload your already moded Source Code
  • Find and install g++-2.95 and gcc-2.95 (I'm using Ubuntu Dapper at the moment, both can be found in the multiverse there)
  • open the console and goto <SourceDirectory>/Shared/qcommon
  • ln -s ../dlls/game game
  • goto <SourceDirectory>/linux
  • open the Makefile in a texteditor
  • search for
    MOUNT_DIR=../..
    and change it to
    MOUNT_DIR=..
  • set all CC= to g++-2.95 (or however you call it in your shell)
  • set all GC= to gcc-2.95 (or however you call it in your shell)
  • search for the "Setup and Build - LINUX" section
  • goto
    TARGETS=\
    and change
    $(<img src='http://forums.ubergames.net/public/style_emoticons/<#EMO_DIR#>/cool.png' class='bbc_emoticon' alt='XD' />/ef2game$(ARCH).$(SHLIBEXT)\
    to
    $(<img src='http://forums.ubergames.net/public/style_emoticons/<#EMO_DIR#>/cool.png' class='bbc_emoticon' alt=':)' />/ef2game$(ARCH).$(SHLIBEXT)
    and
    $(<img src='http://forums.ubergames.net/public/style_emoticons/<#EMO_DIR#>/cool.png' class='bbc_emoticon' alt=':)' />/(PLATFORM)ef2ded
    to
    #$(<img src='http://forums.ubergames.net/public/style_emoticons/<#EMO_DIR#>/cool.png' class='bbc_emoticon' alt=':)' />/(PLATFORM)ef2ded


#7 Pollywog

Pollywog

    Member

  • Members
  • Pip
  • 4 posts

Posted 14 February 2009 - 03:35 AM

I did those things (thanks for the tip) and I now get this:

linux-desktop:~/ef2/ef2GameSource3/linux$ make
make targets B=releasei386-glibc CFLAGS="-Dstricmp=strcasecmp -Dstrcmpi=strcasecmp -Dstrnicmp=strncasecmp -pipe -DNDEBUG -O6 -march=pentium -fomit-frame-pointer -pipe -ffast-math -falign-loops=2 -falign-jumps=2 -falign-functions=2 -fno-strict-aliasing -fstrength-reduce -Wno-deprecated"
make[1]: Entering directory `/home/linux/ef2/ef2GameSource3/linux'
make[1]: *** No rule to make target `../DLLs/game/changePosture.cpp', needed by `releasei386-glibc/game/changePosture.o'. Stop.
make[1]: Leaving directory `/home/linux/ef2/ef2GameSource3/linux'
make: *** [build_release] Error 2

I am using the g++ compiler that comes with Ubuntu Hardy Heron, not the old 2.95 version.

#8 Pollywog

Pollywog

    Member

  • Members
  • Pip
  • 4 posts

Posted 15 February 2009 - 10:18 PM

I also had to make a symlink from dlls/ to DLLs/ and then my errors went like this:

~/src/ef2GameSource3/linux$ make
make targets B=releasei386-glibc CFLAGS="-Dstricmp=strcasecmp -Dstrcmpi=strcasecmp -Dstrnicmp=strncasecmp -pipe -DNDEBUG -O6 -march=pentium -fomit-frame-pointer -pipe -ffast-math -falign-loops=2 -falign-jumps=2 -falign-functions=2 -fno-strict-aliasing -fstrength-reduce -Wno-deprecated"
make[1]: Entering directory `/home/pollywog/src/ef2GameSource3/linux'
g++ -DGAME_DLL -DDEDICATED -DMISSIONPACK -DLINUX -Dstricmp=strcasecmp -Dstrcmpi=strcasecmp -Dstrnicmp=strncasecmp -pipe -DNDEBUG -O6 -march=pentium -fomit-frame-pointer -pipe -ffast-math -falign-loops=2 -falign-jumps=2 -falign-functions=2 -fno-strict-aliasing -fstrength-reduce -Wno-deprecated -fPIC -I../DLLs -I../Shared -I../Executable -I../Shared/qcommon -I../Libs -o releasei386-glibc/game/changePosture.o -c ../DLLs/game/changePosture.cpp
In file included from ../DLLs/game/g_local.h:30,
from ../DLLs/game/actor.h:31,
from ../DLLs/game/changePosture.cpp:25:
../DLLs/game/container.h: In member function ‘void Container<Type>::SetObjectAt(int, const Type&)’:
../DLLs/game/container.h:214: error: ‘gi’ was not declared in this scope
../DLLs/game/container.h: In member function ‘Type& Container<Type>::ObjectAt(int) const’:
../DLLs/game/container.h:350: error: ‘gi’ was not declared in this scope
../DLLs/game/container.h: In member function ‘Type* Container<Type>::AddressOfObjectAt(int)’:
../DLLs/game/container.h:368: error: ‘gi’ was not declared in this scope
../DLLs/game/container.h: In member function ‘void Container<Type>::InsertObjectAt(int, const Type&)’:
../DLLs/game/container.h:387: error: ‘gi’ was not declared in this scope
../DLLs/game/container.h: In member function ‘void Container<Type>::RemoveObjectAt(int)’:
../DLLs/game/container.h:457: error: ‘gi’ was not declared in this scope
../DLLs/game/container.h:463: error: ‘gi’ was not declared in this scope
../DLLs/game/container.h: In member function ‘void Container<Type>::RemoveObject(const Type&)’:
../DLLs/game/container.h:487: error: ‘gi’ was not declared in this scope
../DLLs/game/container.h: In member function ‘void Container<Type>::Sort(int (*)(const void*, const void*))’:
../DLLs/game/container.h:503: error: ‘gi’ was not declared in this scope
In file included from ../DLLs/game/g_local.h:181,
from ../DLLs/game/actor.h:31,
from ../DLLs/game/changePosture.cpp:25:
../DLLs/game/class.h: At global scope:
../DLLs/game/class.h:368: error: declaration of ‘operator==’ as non-function
../DLLs/game/class.h:368: error: expected ‘;’ before ‘<’ token
../DLLs/game/class.h:369: error: declaration of ‘operator!=’ as non-function
../DLLs/game/class.h:369: error: expected ‘;’ before ‘<’ token
../DLLs/game/class.h:370: error: declaration of ‘operator==’ as non-function
../DLLs/game/class.h:370: error: expected ‘;’ before ‘<’ token
../DLLs/game/class.h:371: error: declaration of ‘operator!=’ as non-function
../DLLs/game/class.h:371: error: expected ‘;’ before ‘<’ token
../DLLs/game/class.h:372: error: declaration of ‘operator==’ as non-function
../DLLs/game/class.h:372: error: expected ‘;’ before ‘<’ token
../DLLs/game/class.h:373: error: declaration of ‘operator!=’ as non-function
../DLLs/game/class.h:373: error: expected ‘;’ before ‘<’ token
In file included from ../DLLs/game/class.h:501,
from ../DLLs/game/g_local.h:181,
from ../DLLs/game/actor.h:31,
from ../DLLs/game/changePosture.cpp:25:
../DLLs/game/archive.h:188: error: too few template-parameter-lists
make[1]: *** [releasei386-glibc/game/changePosture.o] Error 1

Could this be because I am using a newer compiler and not gcc/g++ version 2.95 as was used originally for the game?

#9 GSIO01

GSIO01

    UberGames Developer

  • UberGames Developer
  • 1,021 posts

Posted 07 June 2009 - 04:44 PM

As I was told the code can be compiled on Ubunto 7.10 with Eclipse without any problems. I haven't tried this yet but will do it when I boot under 7.10 the next time.

#10 Pollywog

Pollywog

    Member

  • Members
  • Pip
  • 4 posts

Posted 07 June 2009 - 05:24 PM

As I was told the code can be compiled on Ubunto 7.10 with Eclipse without any problems. I haven't tried this yet but will do it when I boot under 7.10 the next time.


I tried it on the command line with Ubuntu Hardy and it didn't work. I don't know why it would require the use of an IDE. If it works in Eclipse, why not also on the command line?



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users