delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/03/21/16:02:03

From: Nate Eldredge <neldredge AT hmc DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Need some class help
Date: 21 Mar 2001 12:46:42 -0800
Organization: InterWorld Communications
Lines: 49
Sender: nate AT mercury DOT st DOT hmc DOT edu
Message-ID: <83y9tyc0jx.fsf@mercury.st.hmc.edu>
References: <NY4u6.34$I81 DOT 1046 AT nntp1 DOT chello DOT se>
NNTP-Posting-Host: mercury.st.hmc.edu
Mime-Version: 1.0
X-Trace: nntp1.interworld.net 985207602 35078 134.173.57.219 (21 Mar 2001 20:46:42 GMT)
X-Complaints-To: usenet AT news DOT interworld DOT net
NNTP-Posting-Date: Wed, 21 Mar 2001 20:46:42 +0000 (UTC)
User-Agent: Gnus/5.0802 (Gnus v5.8.2) Emacs/20.5
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Daniel Eliasson" <danieleliasson AT chello DOT se> writes:

> Hi... I'm rather new to C++, but I'm trying to code a small game. The
> problem however is that I get some rather peculiar (in my view) errors when
> I try to compile player.cpp
> 
> player.cpp:20: syntax error before `{'
> player.cpp:32: ANSI C++ forbids declaration `Player' with no type
> player.cpp: In function `int Player(char * = "Mr. I\'m too lazy to name
> myself.
> I suck.")':
> player.cpp:38: type mismatch with previous external decl
> player.cpp:28: previous external decl of `char * weaponCache[10]'
> player.cpp:38: storage size of `weaponCache' isn't constant
> player.cpp:51: invalid types `int[int]' for array subscript
> player.cpp: At top level:
> player.cpp:61: parse error before `}'
> player.cpp:65: syntax error before `::'
> player.cpp:70: syntax error before `::'
> player.cpp:74: ANSI C++ forbids declaration `pGetY' with no type
> player.cpp:87: syntax error before `::'
> player.cpp:95: parse error before `;'
> player.cpp:95: syntax error before `++'
> player.cpp:97: parse error before `;'
> player.cpp:97: syntax error before `++'
> player.cpp:118: syntax error before `::'
> player.cpp:127: syntax error before `++'
> player.cpp:135: syntax error before `--'
> player.cpp:143: syntax error before `++'
> player.cpp:151: syntax error before `--'
> 
> 
> And the code:
> 
> #include "game.h"
> 
> Class Player
  ^^^^^

"class".  Case is sensitive.

I think many of your other errors are an indirect result of this.  Fix
this, try again, and post back if you have further intractable
problems.

-- 

Nate Eldredge
neldredge AT hmc DOT edu

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019