Compiling Micropolis (Simcity) on Ubuntu Intrepid (8.10) and Jaunty (9.04)
Update: Starting from Ubuntu Karmic (9.10), Micropolis is in your apt!
You need the following:
sudo apt-get install libx11-dev libxpm-dev x11proto-xext-dev libxext-dev
You also need yacc, it will fail if you use bison or btyacc:
btyaccpa.ske:111: erreur: expected specifier-qualifier-list before ‘yyparsestate’
btyaccpa.ske:128: erreur: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
btyaccpa.ske:131: erreur: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
btyaccpa.ske:180: erreur: expected ‘)’ before ‘*’ token
btyaccpa.ske:181: erreur: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
btyaccpa.ske:182: erreur: expected ‘)’ before ‘*’ token
btyaccpa.ske: In function ‘yyparse’:
btyaccpa.ske:193: erreur: ‘yyparsestate’ undeclared (first use in this function)
btyaccpa.ske:193: erreur: (Each undeclared identifier is reported only once
btyaccpa.ske:193: erreur: for each function it appears in.)
btyaccpa.ske:193: erreur: ‘yyerrctx’ undeclared (first use in this function)
btyaccpa.ske:206: erreur: ‘yyps’ undeclared (first use in this function)
btyaccpa.ske:257: erreur: ‘yypath’ undeclared (first use in this function)
Or:
tclxgdat.y:67.15: syntax error, unexpected =
tclxgdat.y:79.16: syntax error, unexpected =
tclxgdat.y:83.25: syntax error, unexpected =
tclxgdat.y:86.32-33: valeur $ invalide : $3
But works with byacc:
sudo apt-get install byacc
Get the micropolis source (micropolis-activity-source.tgz) from http://www.donhopkins.com/home/micropolis/ , extract it:
tar -zxvf micropolis-activity-source.tgz
cd micropolis-activity/
Then apply this patch and compile:
wget http://rmdir.de/~michael/micropolis_git.patch
patch -p1 < micropolis_git.patch
cd src
make clean (if you tried compiling with another yacc before)
make install
If you get the following error then when doing ./Micropolis:
sh: Syntax error: Bad fd number
sh: Syntax error: Bad fd number
Do:
sudo apt-get install rpl
go inside the micropolis-activity folder and run:
rpl -R “/bin/sh” “/bin/bash” *
And recompile Micropolis:
cd src
make clean install
Enjoy Micropolis! 🙂
New DDoS attacks exploit recursive DNS Servers Interstate 76′ D3D patch + Gold Patch + Force Feedback Patch
Thank you for posting this how-to.
hi , i get the error :
/usr/bin/ld: cannot find -ly
collect2: ld returned 1 exit status
what should i do , in order to fix it 🙂
thanks
Hi Serj,
You should try to use bison instead of byacc. This article is old, at that time it wouldn’t compile with bison, i’ve checked now on debian testing and it went fine.
If it still doesn’t work, you might want to take out “-ly”.
Also remember to check in the packages of your distribution, the game might be packaged already. It is available in ubuntu for quite some time now 🙂
Kevin