Hi All,
I've decided to try learning to program this new year, I was taught some of the basics in school, but I must disclaim that I am still very much a newbie. There is an error I had when compiling Angband, and I was wondering if someone would be willing to help explain it to me.
Steps I took:
1. Downloaded and extracted the angband-3.2.0.tar.gz from rehial.org to my desktop.
2. Opened up Microsoft Visual C++ 2010 Express
3. Clicked on "Tools"->"Visual Studio Command Prompt"
4. Changed directory to angband-3.2.0\src\
5. Ran "nmake /f Makefile.nmake"
The error:
game-cmd.c
game-cmd.c(396) : error C2143: syntax error : missing ';' before 'type'
game-cmd.c(396) : error C2143: syntax error : missing ';' before 'type'
game-cmd.c(396) : error C2143: syntax error : missing ')' before 'type'
game-cmd.c(396) : error C2143: syntax error : missing ';' before 'type'
game-cmd.c(396) : error C2065: 'i' : undeclared identifier
game-cmd.c(396) : warning C4552: '<' : operator has no effect; expected operator
with side-effect
game-cmd.c(396) : error C2065: 'i' : undeclared identifier
game-cmd.c(396) : error C2059: syntax error : ')'
game-cmd.c(397) : error C2143: syntax error : missing ';' before '{'
game-cmd.c(398) : error C2065: 'i' : undeclared identifier
game-cmd.c(401) : error C2044: illegal continue
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
I took a look at line 396 in game-cmd.c and here is the code:
for (size_t i = 0; i < N_ELEMENTS(item_selector); i++)
I've found that I can get around the error if I comment out like so:
for (/*size_t */i = 0; i < N_ELEMENTS(item_selector); i++)
I also declare "i" as an integer at the beginning of the code.
Again, because I'm a newbie I really don't understand the code well enough to know if the fix I made is a good one, or just buggering things up further. Any help would be much appreciated.
I've decided to try learning to program this new year, I was taught some of the basics in school, but I must disclaim that I am still very much a newbie. There is an error I had when compiling Angband, and I was wondering if someone would be willing to help explain it to me.
Steps I took:
1. Downloaded and extracted the angband-3.2.0.tar.gz from rehial.org to my desktop.
2. Opened up Microsoft Visual C++ 2010 Express
3. Clicked on "Tools"->"Visual Studio Command Prompt"
4. Changed directory to angband-3.2.0\src\
5. Ran "nmake /f Makefile.nmake"
The error:
game-cmd.c
game-cmd.c(396) : error C2143: syntax error : missing ';' before 'type'
game-cmd.c(396) : error C2143: syntax error : missing ';' before 'type'
game-cmd.c(396) : error C2143: syntax error : missing ')' before 'type'
game-cmd.c(396) : error C2143: syntax error : missing ';' before 'type'
game-cmd.c(396) : error C2065: 'i' : undeclared identifier
game-cmd.c(396) : warning C4552: '<' : operator has no effect; expected operator
with side-effect
game-cmd.c(396) : error C2065: 'i' : undeclared identifier
game-cmd.c(396) : error C2059: syntax error : ')'
game-cmd.c(397) : error C2143: syntax error : missing ';' before '{'
game-cmd.c(398) : error C2065: 'i' : undeclared identifier
game-cmd.c(401) : error C2044: illegal continue
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
I took a look at line 396 in game-cmd.c and here is the code:
for (size_t i = 0; i < N_ELEMENTS(item_selector); i++)
I've found that I can get around the error if I comment out like so:
for (/*size_t */i = 0; i < N_ELEMENTS(item_selector); i++)
I also declare "i" as an integer at the beginning of the code.
Again, because I'm a newbie I really don't understand the code well enough to know if the fix I made is a good one, or just buggering things up further. Any help would be much appreciated.
Comment