smearle / gym-city

An interface with micropolis for city-building agents, packaged as an OpenAI gym environment
MIT License
142 stars 18 forks source link

error: ‘DOMAIN’ undeclared (first use in this function) #11

Closed leckylao closed 3 years ago

leckylao commented 4 years ago

Hi Sam,

I am trying to build micropolis and play with the game. Firstly tried https://github.com/SimHacker/micropolis but can't install pycairo due to python2.7 sunset. And when running make on gym_city/envs/micropolis I have the following errors. Any ideas?

gcc -O3 -DIS_LINUX  -I../../tcl  -DTCL_HAVE_SETLINEBUF -DTCL_32_BIT_RANDOM -DTCL_POSIX_SIG -DTCL_TM_GMTOFF   -c -o tclxfmat.o tclxfmat.c
tclxfmat.c: In function ‘ReturnFPMathError’:
tclxfmat.c:125:13: error: ‘DOMAIN’ undeclared (first use in this function)
  125 |        case DOMAIN:
      |             ^~~~~~
tclxfmat.c:125:13: note: each undeclared identifier is reported only once for each function it appears in
tclxfmat.c:128:13: error: ‘SING’ undeclared (first use in this function)
  128 |        case SING:
      |             ^~~~
tclxfmat.c:131:13: error: ‘OVERFLOW’ undeclared (first use in this function); did you mean ‘EOVERFLOW’?
  131 |        case OVERFLOW:
      |             ^~~~~~~~
      |             EOVERFLOW
tclxfmat.c:134:13: error: ‘UNDERFLOW’ undeclared (first use in this function); did you mean ‘EOVERFLOW’?
  134 |        case UNDERFLOW:
      |             ^~~~~~~~~
      |             EOVERFLOW
tclxfmat.c:137:13: error: ‘TLOSS’ undeclared (first use in this function)
  137 |        case TLOSS:
      |             ^~~~~
tclxfmat.c:138:13: error: ‘PLOSS’ undeclared (first use in this function)
  138 |        case PLOSS:
      |             ^~~~~
smearle commented 3 years ago

Hm, I haven't seen this before.

It's true that I had to port the original micropolis (which you link above) over to python3 to get it to compile on my machine. Those changes are reflected in the version of micropolis contained in this repository. Simple changes to swig/makefiles, and some replaced Gtk functions.

Is this the full traceback? If not, include it and I'll see if I can't make some sense of it.

PS sorry for the delay, I must have missed this earlier.

leckylao commented 3 years ago

Thanks @smearle for the reply. It's ok I have played the game using the java version. Just to double check is the python version the same as the java version?

smearle commented 3 years ago

Oh, you literally just wanted to play the game? No, I have no idea. Enjoy!