How to Fix this Unresolved External Symbol Problem

I am trying to write a simple program that lets me output an inventory of games but I've been stuck for about 5 hours trying to figure out why I cant call ANY function without it telling me "Unresolved External Symbol" error or something. Can someone try this code out and explain what I am doing wrong and/or how i can fix it?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <iostream>
using namespace std;

class games {
public:
	void showInven();
	char getChoice(char, string, char);
	double priceCalc(double); //getPrice * 15% tax
	void printReciept(); //Prints out the subtotal and game choice for the user.
private:
	double gamePrice; //Price of Each game
	char gameSystem; //G=GameCube, X=Xbox, P=PlayStation
	string gameTitle;
	int gameChoice; // 1=game 1 2=game 2 3=game 3
	bool keepShopping; //Y=Yes N=No, Exit
	double subtotal;

};

int main()
{
	games myInven;
	cout << "***********************\nWelcome to Game Central\n***********************\n\n";
	myInven.showInven();
	return 0;
}

void showInven()
{
	cout << "Video Game Inventory:\n" << endl;
	cout << "X=Xbox Games $35.99:\n1)Halo: CE\n2)Madden 2007\n3)Dead or Alive\n\n";
}

For future reference, it helps if you told us what the unresolved external symbol was (ie, gave us the full error and not just half of it)

Anyway, 99% of the time this means the linker can't find a body to a function.

In you case, you never gave games::showInven a body.

Instead, you wrote a GLOBAL showInven function (which the compiler treats as a totally separate function).


The solution here is to change line 28 to this:

void games::showInven()
OMG i completely forgot about that Thank you. Sorry about that this is my first time on these forums (or any code forums for that matter). That fixed the problem. Is there any way I can +rep or anything? =)
You mean increase your reputation on these forums? Just post a lot of stuff regularly and you'll get a reputation depending on what you post. As a helper, a person who requires a lot of help, or... a spammer.

If you didn't mean increase your reputation around here, what did you mean?

Welcome, by the way, to the forum of insane geeks who do weird stuff you'd never have thought possible with a flash drive.

-Albatross
Last edited on
He means increase the rep of the guy who helped him. ;)

But no, there is nothing like that here.
Is this really the forum of insane geeks? Couse i'm insane, but not geek :D
Topic archived. No new replies allowed.