c++ error message system cannot find file specified

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Oct 2009
Posts: 18
Reputation: Gem74 is an unknown quantity at this point 
Solved Threads: 0
Gem74's Avatar
Gem74 Gem74 is offline Offline
Newbie Poster

c++ error message system cannot find file specified

 
0
  #1
Oct 25th, 2009
when I compile, there are no errors, but when I run the program it tells me there are build errors and then "the system cannot find the file specified." I have copied and restarted a new project, then new item and still get same error message. Can someone tell me what the error is? Thanks.

#include <iostream>
using namespace std;

class testClass
{public:
int sum();
void print();
testClass();
testClass(int a, int b);

private:
int x;
int y;
};

int testClass :: sum ()
{return x + y;}

testClass :: testClass (int a, int b)
{ x=a, y=b ; }

testClass :: testClass ()
{ x=0, y=0 ; }

void print ()
{cout << "Sum of one, a + b = " << endl;
cout << "Sum of two, a + b = " << endl;
}


/* an entry point for program execution */
int main()
{
testClass one; //default constructor called
testClass two (2,2); //constructor with 2 values called
one.print();
two.print();

}
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,625
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1496
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning
 
-7
  #2
Oct 25th, 2009
>>when I compile, there are no errors,
Ditch the compiler and use a different one. There is a link error.



>>void print ()

Wrong. should be void testClass::print ()
Last edited by Ancient Dragon; Oct 25th, 2009 at 10:24 pm.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 18
Reputation: Gem74 is an unknown quantity at this point 
Solved Threads: 0
Gem74's Avatar
Gem74 Gem74 is offline Offline
Newbie Poster

got it!

 
0
  #3
Oct 25th, 2009
Originally Posted by Ancient Dragon View Post
>>when I compile, there are no errors,
Ditch the compiler and use a different one. There is a link error.




>>void print ()

Wrong. should be void testClass::print ()
ok, Great! Thank you, this worked, it ran! I thought I had tried this but guess I didn't.

Thanks!
Last edited by Gem74; Oct 25th, 2009 at 10:47 pm.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC