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.
SUSE 10.1 x86
1) There was no configure file, so I ran
aclocal -I .
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:
into the set of include statements at the beginning of the file.
4) For some reason, the SDL_image RPM wasn't properly installing "libSDL_image.so", so I had to build it from source.
5) Another build error occured relating to tinyxml:
make: Entering directory `/home/matt/Documents/Downloads/test/kyra/tinyxml'
make: *** 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/libengine.so: undefined reference to `grinliz::GL_LoadLibrary(char const*)'
../engine/.libs/libengine.so: undefined reference to `grinliz::GL_LoadFunction(void*, char const*)'
Both of these functions are defined in grinliz/gldynamic.cpp. In kyra/engine/Makefile.am, add "../../grinliz/gldynamic.cpp" to "libengine_la_SOURCES".
Then from the "kyra" directory, run:
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:
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.
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?
Ah, so there were problems with autogen. The command sequence of:
aclocal -I .
Seemed to do the trick.
And yes, everything worked after the above described issues were taken care of. The tests built using libkyra.so. 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!
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
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.
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 libkyra.so, the other is libengine.so.
If I run objdump -x libkyra.so| grep NEEDED, I get:
If I run ldd libkyra.so, I learn that it is looking for libpng12.so, libengine.so, libSDL-1.2.so, and libSDL_image-1.2.so all in my custom lib directory.
However, if I do the same with libengine.so, I get:
ldd libengine.so 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?
Oh, I should mention that ldd libengine.so does also show other dependencies:
$ ldd libengine.so
linux-gate.so.1 => (0xffffe000)
libSDL-1.2.so.0 => /usr/lib/libSDL-1.2.so.0 (0xb7e79000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0xb7e67000)
libSDL_image-1.2.so.0 => /usr/lib/libSDL_image-1.2.so.0 (0xb7e4c000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7d67000)
libm.so.6 => /lib/tls/libm.so.6 (0xb7d41000)
libc.so.6 => /lib/tls/libc.so.6 (0xb7c0f000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7c04000)
libasound.so.2 => /usr/lib/libasound.so.2 (0xb7b43000)
libdl.so.2 => /lib/tls/libdl.so.2 (0xb7b3f000)
libdirectfb-0.9.so.25 => /usr/lib/libdirectfb-0.9.so.25 (0xb7ae8000)
libfusion-0.9.so.25 => /usr/lib/libfusion-0.9.so.25 (0xb7ae1000)
libdirect-0.9.so.25 => /usr/lib/libdirect-0.9.so.25 (0xb7ad2000)
libvga.so.1 => /usr/lib/libvga.so.1 (0xb7a72000)
libpng12.so.0 => /usr/lib/libpng12.so.0 (0xb7a4f000)
libz.so.1 => /usr/lib/libz.so.1 (0xb7a3b000)
As you can see, libdirectfb is also listed, which probably wouldn't be if it was using my custom SDL libraries.
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.
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 ?
By the way I got an error not mentioned here (between step 5 and 6):
make: *** Ingen regel för att skapa målet "../tinyxml/libtinyxml.la", som behövs till "krencoder". Stannar.
make: 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 libtinyxml.la *.o' manually in the tinyxml directory to get pass that.
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.
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 ?
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 libSDL.la 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/libSDL.la 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 libSDL.la 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
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/Makefile.am
After that you need to run autogen or autoreconf again so Makefile.in 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.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.