GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 29-Nov-2007, 13:29
seasons seasons is offline
New Member
 
Join Date: Nov 2007
Posts: 7
seasons is on a distinguished road

Need urgent help. Nonsensical compile errors on test code (for game)


I'm developing code for one portion of a game my team is creating, and I've begun running the tests to ensure it works as expected.

However, while I have fixed all other errors I can, the compiler seems to be generating syntax errors that make little to no sense.

First error:
objecttest.cpp(30) : error C2059: syntax error : ')'
CPP / C++ / C Code:
cObject* testOb2 = new cObject(position, 100, e_Object, e_System, "default", 100);
cEnemy* testEn = new cEnemy(position, 100, "default", 100, 10, 2, 10);
cProjectile* testPro = new cProjectile(position, 100, "default", 100, 10,);  /// Error points to here
cEnemy and cProjectile are subclasses of cObject, which is not declared abstract. The calls are to the advanced constructors, which also call the cObject constructor shown.

The remainded of the 101 errors are this:
objecttest.cpp(67) : error C2143: syntax error : missing ';' before '{'
And one warning:
objecttest.cpp(67) : warning C4390: ';' : empty controlled statement found; is this the intent?
CPP / C++ / C Code:
testEn->loadData(1);
cout<<"Points: "<<testEn->getPoints()<<endl;
cout<<"Health: "<<testEn->addDamage(0)<<endl;
cout<<"Damage 1: "<<testEn->addDamage(1)<<endl;
cout<<"Firing"<<endl;
stFire * firing = testEn->Fire(100);
if(firing == NULL)    ///Error points to here
{
	cout<<"Error firing."<<endl;
	return 1;
}

I'm at a total loss as to what is happening. I can post further in depth code if necessary, but we're on a strict deadline of tomorrow afternoon.
  #2  
Old 29-Nov-2007, 13:41
seasons seasons is offline
New Member
 
Join Date: Nov 2007
Posts: 7
seasons is on a distinguished road

Re: Need urgent help. Nonsensical compile errors on test code (for game)


...
...
...
Right, nevermind. I'm an idiot.

CPP / C++ / C Code:
cProjectile* testPro = new cProjectile(position, 100, "default", 100, 10,);

Oh see the floating comma at the end!

Fixed, all the errors are gone.
 
 

Recent GIDBlogUS Elections and the ?Voter?s Responsibility? by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
my code has errors.. HELP bengt23648 C Programming Language 5 18-Aug-2007 10:48
How to sort random access file? wmmccoy0910 C Programming Language 12 04-Sep-2006 04:40
Compile Errors jdbrine C++ Forum 3 30-Jun-2006 12:11
Compile Errors due to Default Parameters jdbrine C++ Forum 1 17-Jun-2006 15:45
fltk-2.0 cvs Plumb FLTK Forum 20 13-Nov-2004 08:10

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 05:58.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.