| DoomCarnage (40) | |
|
Hi. I am new to C++ and i tried to break a main file to 3 parts and i got these 2 error which i don't know wat it is 1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup 1>C:\Documents and Settings\Zx\Desktop\Notes\Computing\assg5q1\Debug\assg5q1.exe : fatal error LNK1120: 1 unresolved externals | |
|
|
|
| hannad (86) | |
| Do you mind posting the code? | |
|
|
|
| writetonsharma (1181) | |
| you dont have a main() function defined in any of your .cpp files. | |
|
|
|
| DoomCarnage (40) | |
|
menufunction.h.h # include <iostream> # include <cstdlib> using namespace std ; extern int choice ; int switchstatement (int) ; main.cpp # include "menufunction.h.h" int choice ; void CoinExchange(float &fifty , float &twenty , float &ten , float &five , float &one) ; void casestatement() ; void LYD () ; char menuinput(void) { cout <<"\n-------------------------------------------\n" <<"\n 1. [C}oin Exchange \n" <<"\n 2. [L]eap Year Determination \n" <<"\n 3. [P]ostage Calculation \n" <<"\n 4. Prime [N]umber Generator \n" <<"\n 5. [Q]uit \n" <<"\n-------------------------------------------\n" <<"Your Choice is : " ; cin >> choice ; void casestatement() ; void LYD () ; cout <<endl ; system("pause") ; return 0 ; } menufunction.cpp.cc # include "menufunction.h.h" void casestatement() { switch (choice) { case 1 : void CoinExchange(float fifty , float twenty , float ten , float five , float one) ; break ; case 2 : void LYD () ; break ; } } void CoinExchange(float &fifty , float &twenty , float &ten , float &five , float &one) { float Money ; cout << "Please key in the total amount change (cents) " ; cin >> Money ; cout << endl ; fifty = Money/50 ; twenty = (Money - fifty*50)/20 ; ten = (Money - twenty*20-fifty*50)/10 ; five = (Money - twenty*20-fifty*50-ten*10)/5 ; one = (Money - twenty*20-fifty*50-ten*10-five*5) ; cout << fifty ; cout << twenty ; cout << ten ; cout << five ; cout << one ; } void LYD () { int year ; cout << "Please key in a year " ; cin >> year ; if (year % 4 != 0) { cout << year << "is not a leap year" ; if (year % 400 == 0 ) cout << year << " is a leap year " ; else if ( year % 100 != 0) cout << year << " is a leap year " ; else cout << year << " is not a leap year " ; } cout << endl ; } I am only half way through the program but first i need to fix this 2 error. Thank you 1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup 1>C:\Documents and Settings\Zx\Desktop\Notes\Computing\assg5q1\Debug\assg5q1.exe : fatal error LNK1120: 1 unresolved externals | |
|
Last edited on
|
|
| mcleano (922) | |||||||
For the beneft of other users...
| |||||||
|
|
|||||||
| writetonsharma (1181) | |
| where is the main() function defined?? thats the error,linker is not able to find main(). | |
|
|
|
| DoomCarnage (40) | |
|
OIC LOL I realise where is the problem thank you. | |
|
Last edited on
|
|