Brinsky / Just-For-Fun-RL

A disorganized and directionless roguelike. This project is just for kicks - anyone is welcome to contribute.
MIT License
1 stars 0 forks source link

Error when I compile #1

Closed schubertr closed 9 years ago

schubertr commented 9 years ago

I am attempting to compile and run the game just so I can fool around with it and stuff. All I have done is forked and cloned your repo, I have not even opened any of the code yet. I navigate to the directory and type "make" and then I get this warning:

Ryans-MacBook-Pro:Just-For-Fun-RL Ryan$ make
gcc -c *.c
monster.c:16:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
1 warning generated.
gcc *.o -o game -lncurses

It's just a warning so the executable "game" is still created. I then try to run that by typing "./game" and get a seg fault:

Ryans-MacBook-Pro:Just-For-Fun-RL Ryan$ ./game
Segmentation fault: 11

It could be unrelated but after trying to run it and getting the seg fault I also have to restart my terminal shell as it clears my screen and my cursor disappears despite still being able to type.

Brinsky commented 9 years ago

First of all, thanks for checking this out!

This was a very real mistake - my system was just lucky enough to return the right value even without the return statement.

The most concerning thing here is that my compiler didn't warn me about it - I thought I had globally enabled "-Wall", but it seems otherwise. Either way, I have added "-Wall" to all compiler invocations in the Makefile.

The terminal clearing/formatting issues are just due to the initialization and improper shutdown of ncurses (the terminal drawing library being used). It's unfortunate, but it shouldn't happen when the game works correctly.

Let me know if any problems persist.

schubertr commented 9 years ago

Got it working, thanks! I'll take a look over the next coupe days/week and fool around with it.