I am getting this error when debugging can anyone tell me what I am doing wrong....keep in mind I am not finished with the program

1>Project 3.obj : error LNK2019: unresolved external symbol "int __cdecl Get_Number(int)" (?Get_Number@@YAHH@Z) referenced in function _main

#include <iostream>
using namespace std;
double Get_Character();
int Get_Number();
void Draw_Rectangle();
void Draw_Top_Bottom();
void Draw_Middle();

int main()
{
	cout << "Programmed by Jim Johnson";
	cout << endl << endl;

	cout << "Type a negative for the height to exit!";

	int height, width;
	char x;
	height = Get_Number();
	width = Get_Number();

	int Get_Number (int x);
	cin >> height;
	cin >> x;
	while (x == 1)
		{
		
		
		height = Get_Number(1);
	}
		width = Get_Number(2);
	return 0;
}

	
	int Get_Number()
{
    int height;
	int width;
	

	cout << "\nEnter the height: ";
	cin >> height;

	cout << endl << "Enter the width: ";
	cin >> width;

	return (height);
}

i did that and this is the errors I am getting now...any suggestions:

1>c:\documents and settings\don & diane kruep\desktop\project 3\project 3.cpp(32) : error C2660: 'Get_Number' : function does not take 1 arguments
1>c:\documents and settings\don & diane kruep\desktop\project 3\project 3.cpp(34) : error C2660: 'Get_Number' : function does not take 1 arguments

#include <iostream>
using namespace std;
double Get_Character();
int Get_Number();
void Draw_Rectangle();
void Draw_Top_Bottom();
void Draw_Middle();

int main()
{
    cout << "Programmed by Jim Johnson";
    cout << endl << endl;

    cout << "Type a negative for the height to exit!";

    int height, width;
    char x;
    height = Get_Number();
    width = Get_Number();


    cin >> height;
    cin >> x;
    while (x == 1)
        {


        height = Get_Number(1);
    }
        width = Get_Number(2);
    return 0;
}


    int Get_Number()
{
    int height;
    int width;


    cout << "\nEnter the height: ";
    cin >> height;

    cout << endl << "Enter the width: ";
    cin >> width;

    return (height);
}

Edited 3 Years Ago by Dani: Formatting fixed

sorry about the wrong slash for code tags

#include <iostream>
using namespace std;
double Get_Character();
int Get_Number();
void Draw_Rectangle();
void Draw_Top_Bottom();
void Draw_Middle();

int main()
{
	cout << "Programmed by Jim Johnson";
	cout << endl << endl;

	cout << "Type a negative for the height to exit!";

	int height, width;
	char x;
	height = Get_Number();
	width = Get_Number();

	
	cin >> height;
	cin >> x;
	while (x == 1)
		{
		
		
		height = Get_Number(1);
	}
		width = Get_Number(2);
	return 0;
}

	
	int Get_Number()
{
    int height;
	int width;
	

	cout << "\nEnter the height: ";
	cin >> height;

	cout << endl << "Enter the width: ";
	cin >> width;

	return (height);
}

You are passing an integer to function Get_Number in lines 29 and 31,

height = Get_Number(1);  // line 29
width = Get_Number(2);   // line 31

but your function specification takes no parameters in line 5:

int Get_Number();

The function calls need to match the function specification. Also, within your Get_Number function, you ask for two numbers but only return 1. I would change the function calls in line 29 and 31 to pass no parameters, and I would only ask for one integer in in the function Get_Number, since only one of the two numbers entered is ever used. The other is lost.

This article has been dead for over six months. Start a new discussion instead.