undefined reference error

I am running my code but I am receiving the following errors:

1
2
3
4
5
6
7
8
mainfile.cpp:(.text+0x13): undefined reference to `pointType::pointType()'
mainfile.cpp:(.text+0x153): undefined reference to `pointType::~pointType()'
mainfile.cpp:(.text+0x16d): undefined reference to `pointType::~pointType()'
/tmp/ccTciTMD.o: In function `circleType::circleType()':
circleTypeImp.cpp:(.text+0x7c): undefined reference to `pointType::pointType()'
/tmp/ccTciTMD.o: In function `circleType::~circleType()':
circleTypeImp.cpp:(.text+0x96): undefined reference to `pointType::~pointType()'
collect2: ld returned 1 exit status 


I am not sure what these mean or what the problem is. Any help is greatly appreciated. Thanks in advance



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
33
  //main.cpp

#include "pointTypee.h"
#include "circleTypee.h"
#include <iostream>

using namespace std;
int main()
{
	pointType p;
	circleType c;
	
	double rad;
	double area;
	double circum;
	
	
	double x;
	double y;
	
	cout << "Enter the x coordinate " << endl;
    cin >> x;
	cout << endl;
	cout << "Enter the y coordinate " << endl;
	cin >> y;
	cout << endl;
	cout << "The X & Y coordinates are: (" << x << "," << y << ")" << endl;
    cout << "The area of the circle is: ";          //Add 
	cout << "The circumference of the circle is: "; //Add 
    
    return 0;
	
}


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
33
34
35
36
37
//PointType.cpp

#include "pointTypee.h"
#include <string>
#include <iostream> 

void pointType::setXCoordinate (double x)
{
	xcoord = x;
}

void pointType::setYCoordinate (double y)
{
	ycoord= y;
}

void pointType::print() const
{
	cout << "The center point is at (" << xcoord << "," << ycoord << ")" << endl;
	cout << endl;
}

double pointType::getXCoordinate() const
{
	return xcoord;
}

double pointType::getYCoordinate() const
{
	return ycoord;
}
pointType::pointType(double xcoord, double ycoord)
{
	 xcoord=0;
	 ycoord=0;
	
}


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
//pointType.h

#ifndef POINTTYPEE_H
#define POINTTYPEE_H
#include <string>

using namespace std;

class pointType
{
public:
	void print() const;
	void setXCoordinate(double xcoord);
	void setYCoordinate(double ycoord);
	double getXCoordinate() const;
	double getYCoordinate() const;
	pointType(void);
	pointType(double xcoord, double ycoord);
	~pointType(void);
	
private:
	double xcoord;
	double ycoord;
	
};
#endif 



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
//circleType.h

#ifndef CIRCLETYPEE_H
#define CIRCLETYPEE_H

#include "pointTypee.h"

class circleType : public pointType
{
public: 
	//circleType(double xcoord, double ycoord, double radius);
	void print() const;
	double setAreaCircle() const;
	double setCircumference() const;
	double getRadius() const;
	circleType(double xcoord, double ycoord, double radius);
	~circleType(void);
	circleType();
	//virtual ~circleType();
	
private:
	double radius;
	static double pie;
	
};
#endif 


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
33
34
//circleTypeImp.cpp

#include "circleTypee.h"
#include "pointTypee.h"
#include <string>
#include <iostream>

double circleType::getRadius()const
{
	return radius;
}

double circleType::setAreaCircle () const
{
	return 3.14 * radius * radius;
}

double circleType::setCircumference() const
{
	return 3.14 * 2 * radius;
}

circleType::circleType()
{
	//circleType::circleType();
}

circleType::~circleType()
{

}

double pie = 3.14;
Last edited on
undefined reference to `pointType::pointType()'
undefined reference to `pointType::~pointType()'

Where are the implementations of these two functions?
Topic archived. No new replies allowed.