Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums

Go Back   Code Forums > Application and Web Development > Standard C, C++

Reply
 
LinkBack Thread Tools Display Modes
Old 08-01-2005, 12:07 PM   #1 (permalink)
slashdot
Registered User
 
Join Date: Dec 2004
Posts: 43
slashdot is on a distinguished road
parse error problem in game.. can't seem to find problem solution.

Ok, I have been creating a simple question and answer RPG game in the last couple days... and I'm at the moment making a random attack, and fight functions. This is file is just a test file, the functions have not been included with the full game, but I seem to have problems with it that I can't figure out. I don't want to move on until I understand my problem, and know how to fix it. Thanx in advance!

http://www.axiomgaming.net/slashdot/george's%20files/randomattack.cpp

It has something to do with the functions.... here is the error output...

anyone@george's:~$ g++ randomattack.cpp -o randomattack
randomattack.cpp: In function `void fight()':
randomattack.cpp:52: error: parse error before `{' token
randomattack.cpp: In function `int main(int, char**)':
randomattack.cpp:81: error: `RndmAtk' undeclared (first use this function)
randomattack.cpp:81: error: (Each undeclared identifier is reported only once
for each function it appears in.)
anyone@george's:~$
slashdot is offline   Reply With Quote
Old 08-01-2005, 12:48 PM   #2 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,694
redhead is on a distinguished road
You're missing an ending } to terminate your void fight() wether it's a missplaced termination of an if() or else clause I can't say.. But thats basicaly it.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 08-01-2005, 12:58 PM   #3 (permalink)
slashdot
Registered User
 
Join Date: Dec 2004
Posts: 43
slashdot is on a distinguished road
O hell ya! Thanx.. I sorta knew it was that.. but since my book C++ for dummies, never really gave me details about errors (I think I can safely say "at all") I can only guess on what error outputs mean. BTW is there a reference to C++ error outputs? And there meanings? Thanx in advance!
slashdot is offline   Reply With Quote
Old 08-02-2005, 12:03 AM   #4 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,694
redhead is on a distinguished road
I havn't come acros one... But it's gold to have an editor which can show you what opening and closing brackets match aswell as make auto indentation, like GNU Emacs then it realy makes things easy to figure out if you've lost a opening or closing bracket somewhere in your code.

These types of errors are usualy hard to find, because they first show them selves a few or even hundred lines further down into the code as where they appear.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 08-02-2005, 07:04 PM   #5 (permalink)
slashdot
Registered User
 
Join Date: Dec 2004
Posts: 43
slashdot is on a distinguished road
Hey I'll look into that.. I already came across several errors relating to misplaced brackets. I'll definitly look into emacs.. I used to use it before but I stop, I didn't know it had that feature. Thanx again.
slashdot is offline   Reply With Quote
Old 08-03-2005, 08:15 PM   #6 (permalink)
fp_unit
mike
 
Join Date: Jan 2005
Location: Ottawa, ON
Posts: 79
fp_unit is on a distinguished road
vim can do matching brackets as well. I'll post my vimrc when I get back to my desktop. What distro are you using?

On Slackware vim settings are stored in user ~/.vimrc files, which override the global /usr/share/vim/vimrc file. I think most/all distros would have this, take a serious look because I just came across it yesterday.

Code:
cp /usr/share/vim/vim6.3/vimrc.EXAMPLE /usr/share/vim/vimrc
The path and filenames might not be EXACT, but poke around the /usr/share folder. Also some distros keep the global file in /etc/vimrc.

The vimrc.EXAMPLE file is set up to enable options programmers would like, syntax highlighting, brace matching, ruler marking, etc...
fp_unit is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parse Error with "else" in simple game. slashdot Standard C, C++ 7 07-20-2005 08:13 AM
[C++]a game problem kanko Platform/API C++ 0 07-14-2005 11:29 PM


All times are GMT -8. The time now is 11:55 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting