| | |
Getting a weird error
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2008
Posts: 49
Reputation:
Solved Threads: 0
I am creating a code, and I'm getting this weird error. I'm sure its a stupid mistake, but I can find it.
And here is the code:
•
•
•
•
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
C++ Syntax (Toggle Plain Text)
using namespace std; void Start (); int e, ecount, multiplicator, mcount, answer; void Start () { e = 0; ecount = 0; 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"; cout << "To start, enter the outcome to the equation: (for example, 6*x=12. 12 would be the outcome)\n"; cin >> ecount; e = ecount; cout << "Thanks! Now enter the multiplicator: (6*x=12. 6 would be the multiplicator)\n"; cin >> mcount; multiplicator = mcount; answer = e/multiplicator; cout << "Finished.\n " << multiplicator << "*x=" << e << "\n x=" << answer << ""; }
Last edited by mybluehair; Nov 13th, 2008 at 8:53 pm.
•
•
Join Date: Oct 2008
Posts: 8
Reputation:
Solved Threads: 0
Here is a version of your code that worked for me
You didnt include iostream for the cin/couts or have a main function.
C++ Syntax (Toggle Plain Text)
#include <iostream> using namespace std; int e, ecount, multiplicator, mcount, answer; int main(int nargs,char* args[]) { e = 0; ecount = 0; 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"; cout << "To start, enter the outcome to the equation: (for example, 6*x=12. 12 would be the outcome)\n"; cin >> ecount; e = ecount; cout << "Thanks! Now enter the multiplicator: (6*x=12. 6 would be the multiplicator)\n"; cin >> mcount; multiplicator = mcount; answer = e/multiplicator; cout << "Finished.\n " << multiplicator << "*x=" << e << "\n x=" << answer << ""; system("pause"); return 0; }
You didnt include iostream for the cin/couts or have a main function.
Last edited by idontexist; Nov 13th, 2008 at 9:43 pm.
Where is your
And please read the Rules, especially this section about thread titles.
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
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
![]() |
Similar Threads
- Weird Error, Please Help! (Windows NT / 2000 / XP)
- Weird error message and pc wont start at all (Troubleshooting Dead Machines)
- logical error (displaying words in order of length) (C++)
- Page Cannot Be Displayed error (Web Browsers)
- weird error message (Windows NT / 2000 / XP)
- Wierd error messages with calculator program (C++)
- Really Weird error thing. (Windows NT / 2000 / XP)
- Really Weird Error... Fibonacci Nums (C++)
- WEIRD! php pages do not load unless i hit refresh (PHP)
Other Threads in the C++ Forum
- Previous Thread: String Arrays
- Next Thread: new to c++ __coverting uppercase to lowercase vice versa
| Thread Tools | Search this Thread |
api application array arrays based beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion convert count data database delete desktop developer directshow dll dynamiccharacterarray email encryption error file forms fstream function functions game generator getline graph homeworkhelper iamthwee ifstream input int integer java lib linux list loop looping loops map math matrix memory multiple newbie news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates text tree url vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






