Archive

Posts Tagged ‘lua’

Compiling Stepmania in Ubuntu Feisty

September 9th, 2007

OK – so I love DDR. I was trying to compile Stepmania this morning, and found that it has some issues. I found the answer to the first issue in this post, and found the answer to the second in this one. Apparently, there are some patches that have gone into 4.0 CVS that haven’t been put into the old source.

Procedure

Get the Stepmania Source and extract it somewhere. Now we need to get stuff to compile it:


sudo apt-get install gcc-3.4 g++-3.4 build-essential liblualib50-dev
CC=gcc-3.4 CXX=g++-3.4 ./configure

Now we should have a nice Makefile and such. If you get dependency problems, you can figure that out on your own. You’ll need SDL and a few other things too, but I already had those.

First, I got this:


rch/InputHandler/InputHandler_SDL.cpp:126: error: `int SDL_EventMask' redeclared as different kind of symbol
/usr/include/SDL/SDL_events.h:108: error: previous declaration of `typedef enum SDL_EventMasks SDL_EventMask'
arch/InputHandler/InputHandler_SDL.cpp:126: error: declaration of `int SDL_EventMask'/usr/include/SDL/SDL_events.h:108: error: conflicts with previous declaration `typedef enum SDL_EventMasks SDL_EventMask'
arch/InputHandler/InputHandler_SDL.cpp: In constructor `InputHandler_SDL::InputHandler_SDL()':
arch/InputHandler/InputHandler_SDL.cpp:176: error: expected unqualified-id before '|=' token
arch/InputHandler/InputHandler_SDL.cpp: In member function `virtual void InputHandler_SDL::Update(float)':
arch/InputHandler/InputHandler_SDL.cpp:195: error: expected primary-expression before ')' token
make[2]: *** [InputHandler_SDL.o] Error 1
make[2]: Leaving directory `/usr/local/src/StepMania-3.9-src/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/local/src/StepMania-3.9-src/src'
make: *** [all-recursive] Error 1

Then, after I fixed that, I got this:


if g++ -DHAVE_CONFIG_H -I. -I. -I. -I/usr/include/lua50 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT   -finline-limit=300   -Wall -W -Wno-unused -Wno-switch -O3 -MT LinuxThreadHelpers.o -MD -MP -MF ".deps/LinuxThreadHelpers.Tpo" \
          -c -o LinuxThreadHelpers.o `test -f 'archutils/Unix/LinuxThreadHelpers.cpp' || echo './'`archutils/Unix/LinuxThreadHelpers.cpp; \
        then mv -f ".deps/LinuxThreadHelpers.Tpo" ".deps/LinuxThreadHelpers.Po"; \
        else rm -f ".deps/LinuxThreadHelpers.Tpo"; exit 1; \
        fi
archutils/Unix/LinuxThreadHelpers.cpp:32: error: ‘gettid’ has not been declared
archutils/Unix/LinuxThreadHelpers.cpp:39: error: expected initializer before ‘CStdStringA’
archutils/Unix/LinuxThreadHelpers.cpp: In function ‘uint64_t GetCurrentThreadIdInternal()’:
archutils/Unix/LinuxThreadHelpers.cpp:136: error: ‘gettid’ was not declared in this scope
make[2]: *** [LinuxThreadHelpers.o] Error 1
make[2]: Leaving directory `/home/jon/Desktop/StepMania-3.9-src/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/jon/Desktop/StepMania-3.9-src/src'
make: *** [all-recursive] Error 1

Time to patch:


cd StepMania-3.9-src/
wget -O - http://ralree.info/assets/2007/9/9/stepmania-3.9-glibc.patch | patch -p1
wget -O - http://ralree.info/assets/2007/9/9/sdl.patch | patch -p0

This should fix most of it. I’m still having trouble with this though:


if g++-3.4 -DHAVE_CONFIG_H -I. -I. -I. -I/usr/include/lua50 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT   -finline-limit=300   -Wall -W -Wno-unused -Wno-switch -O3 -MT CryptHelpers.o -MD -MP -MF ".deps/CryptHelpers.Tpo" \
          -c -o CryptHelpers.o `test -f 'CryptHelpers.cpp' || echo './'`CryptHelpers.cpp; \
        then mv -f ".deps/CryptHelpers.Tpo" ".deps/CryptHelpers.Po"; \
        else rm -f ".deps/CryptHelpers.Tpo"; exit 1; \
        fi
crypto51/misc.h: In function `std::string CryptoPP::IntToString(T, unsigned int) [with T = unsigned int]':
crypto51/simple.h:25:   instantiated from here
crypto51/misc.h:176: warning: comparison of unsigned expression < 0 is always false
g++-3.4 -finline-limit=300   -Wall -W -Wno-unused -Wno-switch -O3  -rdynamic -o stepmania  Screen.o ScreenAttract.o ScreenBookkeeping.o ScreenBranch.o ScreenCaution.o
################### ...........
################### ...........
pubkey.o queue.o randpool.o rsa.o sha.o strciphr.o CryptHelpers.o -lvorbisfile -lvorbis -logg -lmad /usr/lib/liblualib50.a /usr/lib/liblua50.a -L/usr/lib -lSDL -lXtst -lGL -lGLU ./libresample/libresample.a -ldl  -lpng -lz -lm -ljpeg -lz -lpthread
`.gnu.linkonce.t._Z23CourseEntryTypeToString15CourseEntryType' referenced in section `.rodata' of EditCoursesMenu.o: defined in discarded section `.gnu.linkonce.t._Z23CourseEntryTypeToString15CourseEntryType' of EditCoursesMenu.o
collect2: ld returned 1 exit status
make[2]: *** [stepmania] Error 1
make[2]: Leaving directory `/nexus/rofl/hank/tmp/StepMania-3.9-src/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/nexus/rofl/hank/tmp/StepMania-3.9-src/src'
make: *** [all-recursive] Error 1

Leave a comment if you know the answer.

Update


00:59:55 < hardwarehank> the stable is - massively unstable
01:00:02 < hardwarehank> needed 2 patches and it still didnt work
01:00:13 < hardwarehank> has a linker error in the final compile :(
01:00:19 < DevastatorIIC> worked immediately after untarring here
01:00:30 < hardwarehank> you got the binary :)
01:00:38 < DevastatorIIC> yeah, and it worked ;)
01:00:41 < hardwarehank> maybe i should do that
01:02:52 < hardwarehank> woohoo
01:02:55 < hardwarehank> DevastatorIIC++

Lesson: Don’t overcomplicate things.


Uncategorized , , , ,

Learning Lua

March 9th, 2007

I’m learning Lua! Here’s fibonacci:


a,b=0,1 do
while true do
  io.write(b)
  a,b = b, b+a
  if a>500 then io.write("\n"); break end
  io.write(", ")
end

Wow, this is kinda fun. I like Lua.


Uncategorized , , ,