| | |
error LNK2001: unresolved external symbol
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jan 2005
Posts: 4
Reputation:
Solved Threads: 0
I have been working on this project for my C++ class that I am taking and Ive gotten an error message I have never seen before. When I am attempting to execute it i get the flowing error:
error LNK2001: unresolved external symbol "int __cdecl s(void)" (?s@@YAHXZ)
I have also posted my code following this. I would appreicate any help that is offered because I have no clue what is going on.
<< moderator edit: added [code][/code] tags >>
error LNK2001: unresolved external symbol "int __cdecl s(void)" (?s@@YAHXZ)
I have also posted my code following this. I would appreicate any help that is offered because I have no clue what is going on.
C++ Syntax (Toggle Plain Text)
// Chapter 4 Project 20 // By William Creech #include <iostream> using namespace std; int s (void); int economy (void); const int a = 10; int aray [a] = {0}; int main () { int cont = 0; int c = 0; while (cont =! -1) cout << "Welcome to Creech Airlines. Please enter \n 1 for 1st class \n 2 for Economy" << endl; cin >> c; switch (c) { case 1: s (); break; case 2: economy (); break; default: cout << "Incorrect selection please enter the number again." << endl; cin >> c; break; } cout << "Are their more people in line?(enter -1 to end)" << endl; cin >> cont; return 0; } int s (int) { int x = 0; if ( aray [0] == 0) { aray [ 0 ] = 1; cout << "You are sitting in 1st class seat one. Thank you, your flight will be leaving shortly." << endl; } else if ( aray [0] != 0) { aray [1] = 1; cout<< "You are sitting in 1st class seat two. Thank you, your flight will be leaving shortly." << endl; } else if (aray [1] != 0) { aray [2] = 1; cout << "You are sitting in 1st class seat three. Thank you, your flight will be leaving shortly." << endl; } else if (aray [2] != 0) { aray[3] = 1; cout << "You are sitting in 1st class seat four. Thank you, your flight will be leaving shortly." << endl; } else if (aray [3] != 0) { aray [4] = 1; cout << "You are sitting in 1st class seat five. Thank you, your flight will be leaving shortly." << endl; } else { cout << "There are no more 1st class seats available. Is it ok to put you in economy class? (Press 1 for ok 2 for no)" << endl; cin >> x; } if ( x == 1) economy(); else cout<< "The next flight will leave in three hours." << endl; return 0; } int economy () { int y = 0; if ( aray [5] == 0 ) { aray [ 5 ] = 1; cout << "You are sitting in Economy class class seat one. Thank you, your flight will be leaving shortly." << endl; } else if ( aray [5] != 0) { aray [6] = 1; cout<< "You are sitting in Economy class seat two. Thank you, your flight will be leaving shortly." << endl; } else if (aray [6] != 0) { aray [7] = 1; cout << "You are sitting in Economy class seat three. Thank you, your flight will be leaving shortly." << endl; } else if (aray [7] != 0) { aray[8] = 1; cout << "You are sitting in Economy class seat four. Thank you, your flight will be leaving shortly." << endl; } else if (aray [8] != 0) { aray [9] = 1; cout << "You are sitting in 1st class seat five. Thank you, your flight will be leaving shortly." << endl; } else { cout << "There are no more Economy class seats available. Is it ok to put you in 1st class class? (Press 1 for ok 2 for no)" << endl; cin >> y; } if ( y == 1) s(); else cout<< "The next flight will leave in three hours." << endl; return 0; }
<< moderator edit: added [code][/code] tags >>
Make sure your function's prototype matches its definition.
int s (void) "One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
![]() |
Similar Threads
- unresolved external symbol error (C++)
- Need help with "error LNK2001 unresolved external symbol" (C++)
- unresolved external symbol _WinMainCRTStartup (VB.NET)
- error LNK2001: unresolved external symbol (C++)
- Unresolved External Symbol? (C)
- unresolved external symbol "a whole bunch of em" (C)
- error LNK2001: unresolved external symbol (C++)
- error LNK2001: unresolved external symbol (C++)
Other Threads in the C++ Forum
- Previous Thread: another oop error cant solve :(
- Next Thread: parsing date strings mm/dd/yy??
Views: 6753 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for C++
6 add api array arrays beginner binary bitmap c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete desktop directshow dll encryption error file forms fstream function functions game getline givemetehcodez google graph homeworkhelper iamthwee ifstream input int integer java lazy lib linkedlist linux loop looping loops map math matrix memory microsoft newbie news node number output parameter pointer problem program programming project proxy python random read recursion recursive reference return sort string strings struct studio system template templates test text tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






