Build Efforts

Matt Brock
  • Matt Brock

    Matt Brock - 2007-02-23


    I ended up having to do a lot funny steps to get Kyra built.  I figured I would document them just in case they would help anybody.  Not all of the problems are related to Kyra.

    Build Environment:
    SUSE 10.1 x86
    GCC 4.1.1
    Autoconf 2.59
    Automake 1.9.6

    1) There was no configure file, so I ran

    aclocal -I .
    libtoolize --force
    automake -a

    I wasn't sure if I was having problems with autogen or not, but I quit using it after a few failed build attempts.

    2) After running "./configure", I get the build errors from "make"

    encoder.h:151: error: extra qualification 'KrEncoder::' on member 'Save'
    imagetree.h:193: error: extra qualification 'KrImageTree::' on member 'HitTestRec'
    progress.h:51: error: extra qualification 'KrProgress::' on member 'KrProgress'
    progress.h:58: error: extra qualification 'KrProgress::' on member 'KrProgress'

    The solution?: Remove the extra qualifiers from the member declarations.

    3) Another build error encountered was

    namefield.h:94: error: expected `)' before '*' token
    namefield.h:117: error: ISO C++ forbids declaration of 'SDL_RWops' with no type
    namefield.h:117: error: expected ';' before '*' token
    namefield.cpp: In member function 'void KrCachedWrite::Write(const std::string&)':
    namefield.cpp:169: error: 'stream' was not declared in this scope
    namefield.cpp:169: error: 'SDL_RWtell' was not declared in this scope
    namefield.cpp:174: error: 'SDL_WriteLE32' was not declared in this scope
    namefield.cpp: In member function 'void KrCachedWrite::Flush()':
    namefield.cpp:196: error: 'stream' was not declared in this scope
    namefield.cpp:196: error: 'SDL_RWseek' was not declared in this scope
    namefield.cpp:197: error: 'SDL_WriteLE32' was not declared in this scope

    Some of the SDL data structures weren't getting included into the build, so I added the line:

    #include "SDL.h"

    into the set of include statements at the beginning of the file.

    4) For some reason, the SDL_image RPM wasn't properly installing "", so I had to build it from source.

    5) Another build error occured relating to tinyxml:

    make[1]: Entering directory `/home/matt/Documents/Downloads/test/kyra/tinyxml'
    make[1]: *** No rule to make target `tinyxml.cpp', needed by `tinyxml.lo'.  Stop.

    There weren't any source files in the tinyxml directory inside the kyra directory.  So I downloaded the tinyxml package seperately, and copied all of the files (except for the Makefile) into the tinyxml directory.  There is another tinyxml directory on the same level as the "kyra" and "grinliz" directories.  I replaced it by unpacking the tinyxml tarball over it.

    6) Another build error:

    ../engine/.libs/ undefined reference to `grinliz::GL_LoadLibrary(char const*)'
    ../engine/.libs/ undefined reference to `grinliz::GL_LoadFunction(void*, char const*)'

    Both of these functions are defined in grinliz/gldynamic.cpp.  In kyra/engine/, add "../../grinliz/gldynamic.cpp" to "libengine_la_SOURCES".

    Then from the "kyra" directory, run:

    automake -a

    This will add the gldynamic.cpp file to the list of sources for the engine library.

    7) The include files installed to /usr/local/include/Kyra reference header files from the grinliz and tinyxml libraries:

    #include "../../grinliz/gldebug.h"
    #include "../../grinliz/gltypes.h"
    #include "../../tinyxml/tinyxml.h"

    So I created two directories /usr/local/include/grinliz and /usr/local/include/tinyxml and placed the header files from each of these packages into those directories.

    I'm not sure how much I was doing wrong in the install, I sometimes skip over the instructions, but hopefully this will save someone the two or three hours.  The demo runs great!  I'm going to attempt a small MMORPG using Kyra for the client (I just need to give it a shot so I can fail and the idea will never pop up in my head again).  I'll definitely be giving Kyra some props if things go well.


    • Gianfranco Berardi

      Thanks for posting all of those steps in one place, Matt!  We have had a few posts recently about individual issues, and you seem to have run into all of them at once. B-)

      As for the autotools, it seems that later builds of Kyra broke them.  That is, your problems with using autogen and automake and such didn't work because so many changes were made that they no longer were expected to work. 

      Am I to understand that you actually got them to work after you made the changes you made?  That is, did you manage to build Kyra into a dynamic library?  Since the autotools build was broken, only static linking as been possible, which isn't great for people who don't want to license their game code under an LGPL-compatible license. 

      I tried to read up on what is needed for the autotools to work, but I was spending more time fighting with it than getting a game finished so I stopped.  I was comparing the difference between Kyra 2.0.7 and Kyra 2.1.3.  The former worked with autobuild while the latter did not. I found the differences that you mentioned, such as tinyxml being in a different directory and such.  I guess I just tried to change the autotool files to match the directory structure rather than change the directory structure to match the autotool files.

      Good luck with your MMO. Where are you going to get the servers?

    • Matt Brock

      Matt Brock - 2007-02-27

      Hey Gianfranco,

      Ah, so there were problems with autogen.  The command sequence of:

      aclocal -I .
      libtoolize --force
      automake -a

      Seemed to do the trick.

      And yes, everything worked after the above described issues were taken care of.  The tests built using  Glad to help!  I'll keep posting issues as they come up.  Let me know if you still can't get things working.  I have my own version of Kyra that I zipped up and put in my gmail account.  If you want me to send it to you let me know.

      As for MMO servers, I figured I'd just host off of my cable connection until I see some popularity starting to generate (I.e. my cable connection can't handle the users).  Right now I'm researching some simple load balancing techniques (I'm planning for expansion whether it happens or not :)) and looking into some formal verification methods for client/server interactions.  So I have a ways to go.  I have a high-level model worked out and all the technology I'll be using planned (Kyra for graphics, RakNet for network, MySQL DBMS for distributed database, and Python for various scripting).  I'm becoming a little less naive as I go along with respect to accomplishing a MMO all on my own, but I figure if I get a simple setup going, then some people will want to help.  For now I'm just in the design phase--don't plan on doing anything in stone for at least a few more months!

    • Gianfranco Berardi

      I just tried to get a shared library out of Kyra, followed your steps, and got it to compile.

      The hard part was getting my binary to use it correctly. I ended up copying the files in kyra/kyra/.lib/ and kyra/kyra/engine/.lib into a bin directory along with my binary, and then I create a script that simply sets an environment variable to let the system know to look in the bin directory before cd-ing into that directory and running the binary.

      I'm not sure if it is the best way, but at least I know I just need that bin directory and my resources directory to run my game.

      My project is called Killer Kittens from Katis Minor, and this is the script I use (modified from someone else's game I had on my hard drive):



      if test "x$LD_LIBRARY_PATH" = "x"; then

      export LD_LIBRARY_PATH
      echo ${LD_LIBRARY_PATH}

      cd bin
      cd $CURRENT_DIR

      I plan to also compile custom versions of libsdl, libsdl-image, and libsdl-mixer and throw the results in my bin directory as well. I want to be able to throw a tar file at someone and have them playing as soon as they extract the files.

    • Gianfranco Berardi

      Actually, I've run into a problem.

      As I said above, I am trying to create custom versions of my libraries. I have custom versions of libsdl and libsdl-image, and when I try  to build kyra, it creates two libraries.  One is, the other is 

      If I run objdump -x| grep NEEDED, I get:


      If I run ldd, I learn that it is looking for,,, and all in my custom lib directory.

      However, if I do the same with, I get:

      ldd does not show any of the custom lib paths.  I am not familiar enough with autotools, but I imagine it is a problem with how it is initially setup. Any ideas?

    • Gianfranco Berardi

      Oh, I should mention that ldd does also show other dependencies:

      $ ldd
     =>  (0xffffe000)
     => /usr/lib/ (0xb7e79000)
     => /lib/tls/ (0xb7e67000)
     => /usr/lib/ (0xb7e4c000)
     => /usr/lib/ (0xb7d67000)
     => /lib/tls/ (0xb7d41000)
     => /lib/tls/ (0xb7c0f000)
     => /lib/ (0xb7c04000)
     => /usr/lib/ (0xb7b43000)
     => /lib/tls/ (0xb7b3f000)
     => /usr/lib/ (0xb7ae8000)
     => /usr/lib/ (0xb7ae1000)
     => /usr/lib/ (0xb7ad2000)
     => /usr/lib/ (0xb7a72000)
              /lib/ (0x80000000)
     => /usr/lib/ (0xb7a4f000)
     => /usr/lib/ (0xb7a3b000)

      As you can see, libdirectfb is also listed, which probably wouldn't be if it was using my custom SDL libraries.

    • Gianfranco Berardi

      I've encountered some problems trying to build Kyra as before once I upgraded autotools. Here are the fixes (using aclocal v1.10):
      In kyra/kyra.m4, you need to change the following line from:


      I found a similar problem with /usr/share/aclocal/smpeg.m4

      Once you make these changes, it should work without a hitch.

    • Daniel Bengtsson

      Good to have the steps listed here, I know I had problems too when I built the last time. But is this project maintained, I mean will fixes to the build procedure be commited to CVS ?

    • Daniel Bengtsson

      By the way I got an error not mentioned here (between step 5 and 6):

      make[1]: *** Ingen regel för att skapa målet "../tinyxml/", som behövs till "krencoder".  Stannar.
      make[1]: Leaving directory `/home/danielb/download/kyra/encoder'
      make: *** [all-recursive] Fel 1

      (Sorry, it's in swedish but it's the standard 'No rule to create target' error.)

      I just ran 'libtool --mode=link gcc -g -O -o *.o' manually in the tinyxml directory to get pass that.

    • Gianfranco Berardi

      If you would like a version of Kyra that actually builds properly, please download:

      You can even run configure && make && make install with this version. While it has some flaws in its build script, it should work well for most purposes.

    • Daniel Bengtsson

      Nice, I tried this file and it worked fine. ( Well using --prefix to configure did not work during make install. )

      Could this file replace the official release so you do not have to look here in the forums for it ?

  • Wesley Johnson

    Wesley Johnson - 2010-05-17

    5/17/2010  compiling  kyra_2_1_3, still getting the same errors your mentioned.
    Errors that I had to fix on kyra_2_1_3:
    Compile on Linux 2.4.31, with GCC 3.3.6, SDL 1.2.

    The unzip of the zip file into "/usr/local/src/kyra", and it created the sub-directories
    tinyxml =>  "/usr/local/src/kyra/tinyxml"
    grinliz =>  "/usr/local/src/kyra/grinliz"
    kyra    =>  "/usr/local/src/kyra/kyra"

    There are no instructions on why there are three independent
    directories in kyra.

    The tinyxml directory has its own makefile.
    The grinliz directory has no instructions and no makefile.
    The program seems to be in the kyra sub-directory.

    INSTALL Instructions say to run ./configure
    Configure file is missing.
    Ran autogen a couple of times and it finally will generate configure.

    Libtool keeps complaining that the has been moved.
    It is in /usr/lib with the rest of the libSDL-1.2 libs.

    Traced to bad install of SDL.  The file /usr/lib/ indicated
    that it was installed in /usr/local/lib.
    The error message was not very clear about what it was detecting.
    The message could say "according to the library has been moved".
    I only discovered this by grep of everything to find some clue as to
    where the /usr/local idea was coming from.

    Fatal error in namefield.cpp, cannot resolve  SDL_RWops
    added to engine/namefield.h
      #include "SDL_rwops.h"

    Fatal error, no rule to make required file tinyxml.cpp.
    The tinyxml directory was unzipped to a separate directory, tinyxml.
    Copied the contents of tinyxml directory to kyra/tinyxml where it
    apparantly belongs (thus overwriting the makefile made by configure).
    Ran ./configure again, and ran make again, which appears to work.

    Fatal error, grinliz libraries are missing.
    The grinliz directory is there, but there is no makefile to create the
    << From Kyra BUG listing
    Because it's missing


    at the end of engine/

    After that you need to run autogen or autoreconf again so gets

    I will copy your posts, and some info, from other bug reports.   Thank you for your posts.
    We can hope the someone from the Kyra team wakes up one of these years and fixes some of this.


Log in to post a comment.