stupid pointless errors......

Posted by Fender on Sat 01 Nov 2003 03:04 PM — 4 posts, 17,323 views.

#0
I'm compiling with msvc++ 6.0, and im getting these errors which make no sense whatsoever.


C:\smaug\dist\src\fight.c(3781) : error C2143: syntax error : missing ';' before 'type'
C:\smaug\dist\src\fight.c(3784) : error C2275: 'CHAR_DATA' : illegal use of this type as an expression
C:\smaug\dist\src\mud.h(101) : see declaration of 'CHAR_DATA'
C:\smaug\dist\src\fight.c(3786) : error C2065: 'argument' : undeclared identifier
C:\smaug\dist\src\fight.c(3786) : warning C4047: 'function' : 'char *' differs in levels of indirection from 'int '
C:\smaug\dist\src\fight.c(3786) : warning C4024: 'one_argument' : different types for formal and actual parameter 1
C:\smaug\dist\src\fight.c(3786) : error C2065: 'arg' : undeclared identifier
C:\smaug\dist\src\fight.c(3786) : warning C4047: 'function' : 'char *' differs in levels of indirection from 'int '
C:\smaug\dist\src\fight.c(3786) : warning C4024: 'one_argument' : different types for formal and actual parameter 2
C:\smaug\dist\src\fight.c(3788) : error C2109: subscript requires array or pointer type
C:\smaug\dist\src\fight.c(3794) : warning C4047: 'function' : 'char *' differs in levels of indirection from 'int '
C:\smaug\dist\src\fight.c(3794) : warning C4024: 'get_char_room' : different types for formal and actual parameter 2
C:\smaug\dist\src\fight.c(3864) : error C2143: syntax error : missing ';' before 'type'
C:\smaug\dist\src\fight.c(3872) : error C2143: syntax error : missing ';' before 'type'
C:\smaug\dist\src\fight.c(3875) : error C2143: syntax error : missing ';' before 'type'
C:\smaug\dist\src\fight.c(3876) : error C2275: 'CHAR_DATA' : illegal use of this type as an expression
C:\smaug\dist\src\mud.h(101) : see declaration of 'CHAR_DATA'
C:\smaug\dist\src\fight.c(3878) : warning C4047: 'function' : 'char *' differs in levels of indirection from 'int '
C:\smaug\dist\src\fight.c(3878) : warning C4024: 'one_argument' : different types for formal and actual parameter 1
C:\smaug\dist\src\fight.c(3878) : warning C4047: 'function' : 'char *' differs in levels of indirection from 'int '
C:\smaug\dist\src\fight.c(3878) : warning C4024: 'one_argument' : different types for formal and actual parameter 2
C:\smaug\dist\src\fight.c(3880) : error C2109: subscript requires array or pointer type
C:\smaug\dist\src\fight.c(3886) : warning C4047: 'function' : 'char *' differs in levels of indirection from 'int '
C:\smaug\dist\src\fight.c(3886) : warning C4024: 'get_char_room' : different types for formal and actual parameter 2
C:\smaug\dist\src\fight.c(3942) : error C2065: 'buf' : undeclared identifier
C:\smaug\dist\src\fight.c(3942) : warning C4047: 'function' : 'char *' differs in levels of indirection from 'int '
C:\smaug\dist\src\fight.c(3942) : warning C4024: 'sprintf' : different types for formal and actual parameter 1
C:\smaug\dist\src\fight.c(3945) : warning C4047: 'function' : 'char *' differs in levels of indirection from 'int '
C:\smaug\dist\src\fight.c(3945) : warning C4024: 'do_wartalk' : different types for formal and actual parameter 2
C:\smaug\dist\src\fight.c(3947) : warning C4047: 'function' : 'char *' differs in levels of indirection from 'int '
C:\smaug\dist\src\fight.c(3947) : warning C4024: 'do_yell' : different types for formal and actual parameter 2
C:\smaug\dist\src\fight.c(3957) : error C2275: 'bool' : illegal use of this type as an expression
C:\smaug\dist\src\mud.h(89) : see declaration of 'bool'
C:\smaug\dist\src\fight.c(3957) : error C2146: syntax error : missing ';' before identifier 'in_arena'
C:\smaug\dist\src\fight.c(3957) : error C2143: syntax error : missing ')' before 'type'
C:\smaug\dist\src\fight.c(3957) : error C2198: 'in_arena' : too few actual parameters
C:\smaug\dist\src\fight.c(3957) : error C2059: syntax error : ')'
C:\smaug\dist\src\fight.c(3962) : warning C4098: 'new_dam_message' : 'void' function returning a value
C:\smaug\dist\src\fight.c(3964) : warning C4098: 'new_dam_message' : 'void' function returning a value
C:\smaug\dist\src\fight.c(3966) : warning C4098: 'new_dam_message' : 'void' function returning a value
C:\smaug\dist\src\fight.c(3968) : warning C4098: 'new_dam_message' : 'void' function returning a value
C:\smaug\dist\src\fight.c(3971) : error C2061: syntax error : identifier 'check_illegal_pk'
C:\smaug\dist\src\fight.c(3971) : error C2059: syntax error : ';'
C:\smaug\dist\src\fight.c(3971) : error C2059: syntax error : 'type'


just in fight.c alone

polymorph.c has a ton of errors, special.c has lots of warnings, and tables.c has over 500 warnings....whats going on?

USA #1
Well, there are a few things here...

For one, SMAUG code is quite messy in that it does not follow the strict ANSI C guidelines. It does its casts quite messily, and that's why you're getting all those warnings and maybe even errors.

For instance, I recently ported a MUD from C to C++, and it compiled fine under C and generated about 400 errors under C++, due to a stricter compiler. It's quite possible that MSVC++ is using a stricter version of the language standards (which actually is a good thing, since it helps avoid mistakes.)

The other thing you may want to look at is that it might not be figuring out that you're compiling in C, not C++, so it may be seeing C++ keywords (e.g. class, new, etc.) and getting confused. It's enough to just change class to Class, or something to that effect.
Australia Forum Administrator #2
Sounds like it is missing a definition. Fix the first error and the others may go away.
USA #3
Could you post 20ish lines of your fight.c file starting at line 3770. What it sounds like you have is a missing ; at the end of a line or function at line 3780 but the fact that the error registers at 3781 doesn't quite guarantee the error is at the line directly preceeding.