error C2011: 'class' type redefinition

So for my Intro C++ class I have to do an assignment using inheritance where there are 3 classes; Package, TwoDayPackage, and OvernightPackage. The latter two inherit from Package. So I have a couple of errors in my program, but I think they all stem from the C2011 error.

Here is the code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include<iostream>

 class Package{

protected:

	double packageOz;
	double pricePerOz;

public:

	char *senderName, *recipientName;
	char *senderAddress, recipientAddress;
	char *senderCity, recipientCity;
	char *senderState, recipientState;
	int senderZIP, recipientZIP;

	virtual double calculateCost();

	Package(double weight, double costPerOz);

};



The error occurs at line 3. I thought maybe there was some premade C++ class or type named Package so I changed the name to PackAge and then to ShipPackage but that didn't help at all.

If it matters at all the other two classes override the calculateCost() function, and the both get error C2504, that the base class is undefined.

Thank you for any help you can give.
I don't see it. The only probable way I can think of that could be causing this is if the class was defined inside a header (e.g. "package.h") and you were doing this in a source:
1
2
#include "package.h"
#include "package.h" 


By the way, next time post the error message, not the error code. Believe it or not, most people don't have Microsoft's compiler error codes memorized.
Yeah, that's not the case, my source file is as follows:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
include "Package.h"


Package::Package(double weight, double costPerOz){

	packageOz=weight;
	pricePerOz=costPerOz;

	if(packageOz<0) packageOz=1;
	if(pricePerOz<0) pricePerOz=1;
}

double Package::calculateCost(){

	return packageOz*pricePerOz;
}


Also what do you mean by post the error message, not just the error code? For error C2011, I posted what Visual Studio 2010 said in the description as the title of the post. And for C2506, I just paraphrased the description.
Topic archived. No new replies allowed.