Getting a weird error

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2008
Posts: 49
Reputation: mybluehair is an unknown quantity at this point 
Solved Threads: 0
mybluehair mybluehair is offline Offline
Light Poster

Getting a weird error

 
0
  #1
Nov 13th, 2008
I am creating a code, and I'm getting this weird error. I'm sure its a stupid mistake, but I can find it.

multiple definition of `Start()'
first defined here
ld returned 1 exit status
C:\Documents and Settings\Andrew\My Documents\projects\equation\Makefile.win [Build Error] [equation.exe] Error 1
And here is the code:

  1. using namespace std;
  2.  
  3. void Start ();
  4.  
  5. int e, ecount, multiplicator, mcount, answer;
  6.  
  7. void
  8. Start ()
  9. {
  10. e = 0;
  11. ecount = 0;
  12. cout << "Welcome to X-solve. This program is designed to solve almost any mathamatical equation that \n includes a variable. For example: 6*x=12. The program would then solve x, which would be 2.\n\n";
  13.  
  14. cout << "To start, enter the outcome to the equation: (for example, 6*x=12. 12 would be the outcome)\n";
  15. cin >> ecount;
  16. e = ecount;
  17. cout << "Thanks! Now enter the multiplicator: (6*x=12. 6 would be the multiplicator)\n";
  18. cin >> mcount;
  19. multiplicator = mcount;
  20. answer = e/multiplicator;
  21. cout << "Finished.\n " << multiplicator << "*x=" << e << "\n x=" << answer << "";
  22. }
Last edited by mybluehair; Nov 13th, 2008 at 8:53 pm.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 8
Reputation: idontexist is an unknown quantity at this point 
Solved Threads: 0
idontexist idontexist is offline Offline
Newbie Poster

Re: Getting a weird error

 
0
  #2
Nov 13th, 2008
Here is a version of your code that worked for me
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5.  
  6. int e, ecount, multiplicator, mcount, answer;
  7.  
  8. int main(int nargs,char* args[])
  9. {
  10. e = 0;
  11. ecount = 0;
  12. cout << "Welcome to X-solve. This program is designed to solve almost any mathamatical equation that \n includes a variable. For example: 6*x=12. The program would then solve x, which would be 2.\n\n";
  13.  
  14. cout << "To start, enter the outcome to the equation: (for example, 6*x=12. 12 would be the outcome)\n";
  15. cin >> ecount;
  16. e = ecount;
  17. cout << "Thanks! Now enter the multiplicator: (6*x=12. 6 would be the multiplicator)\n";
  18. cin >> mcount;
  19. multiplicator = mcount;
  20. answer = e/multiplicator;
  21. cout << "Finished.\n " << multiplicator << "*x=" << e << "\n x=" << answer << "";
  22. system("pause");
  23. return 0;
  24. }

You didnt include iostream for the cin/couts or have a main function.
Last edited by idontexist; Nov 13th, 2008 at 9:43 pm.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 49
Reputation: mybluehair is an unknown quantity at this point 
Solved Threads: 0
mybluehair mybluehair is offline Offline
Light Poster

Re: Getting a weird error

 
0
  #3
Nov 13th, 2008
hmmm, still gettting same error with that code.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 968
Reputation: MosaicFuneral is just really nice MosaicFuneral is just really nice MosaicFuneral is just really nice MosaicFuneral is just really nice MosaicFuneral is just really nice 
Solved Threads: 92
MosaicFuneral's Avatar
MosaicFuneral MosaicFuneral is offline Offline
Posting Shark

Re: Getting a weird error

 
0
  #4
Nov 14th, 2008
Worked for me. Post your compiler and options.
"Jedenfalls bin ich überzeugt, daß der Alte nicht würfelt."
"I became very sensitive to what will happen to all this and all of us." -Two geniuses named Albert
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 3,114
Reputation: WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of 
Solved Threads: 281
Moderator
WaltP's Avatar
WaltP WaltP is offline Offline
Posting Sensei

Re: Getting a weird error

 
0
  #5
Nov 14th, 2008
Where is your main() function?

And please read the Rules, especially this section about thread titles.
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC