Recipe for target failed. Error

Aahhhhh! Tried compiling this class and the error "Recipe for target 'Calculator.hpp' failed." popped up. It showed a Makefile.win too and it was red on the last line. I use Dev C++.

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
/**************************************
Calculator.hpp
Class header program for Calculator.cpp
Date created: 17/10/21
Date modified: 17/10/21
Revisions:
1.0 Start editing 17/10/21 (OGA)
**************************************/
#include <iostream>
class Calculator
{
	public:											//Class definer
		int Add(int addend,int addend2)
		int Subtract(int subtrahend,int minuend)
		int Multiply(int input,int input2)
		int Divide(int divid,int divis)
		int Bark()									//Hold on, Calculators can bark?!
};

int Calculator::Add(int addend,int addend2)
{
	return addend+addend2;
}

double calculator::divide( int divid, int divis )
{
   return ( divid + 0.0 ) / divis;
}
Compare:
declaration:
int Divide(int divid,int divis)
definition:
double calculator::divide( int divid, int divis )

They don't match. int is not double. 'D' is not 'd'.

An int can't store a decimal fraction like 0.4


Don't start an unnecesary new thread for the same problem.
Got it. But now it has 3 new errors:
C:\crossdev\src\mingw-w64-v3-git\mingw-w64-crt\crt\crt0_c.c undefined reference to `WinMain@16'

D:\collect2.exe [Error] ld returned 1 exit status

25 D:\Makefile.win recipe for target 'Calculator.exe' failed

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
#include <iostream>
class Calculator
{
	private:											//Class definer
		
		int Add( int addend, int addend2 );
		int Subtract( int minuend, int subtrahend );
		int Multiply( int input, int input2 );
		double Divide( int divid, int divis );
	
	public:
		
		void Menu();
};

int Calculator::Add( int addend, int addend2 )
{
	return addend+addend2;
}

int Calculator::Subtract( int minuend, int subtrahend )
{
	return minuend-subtrahend;
}

int  Calculator::Multiply( int input, int input2 )
{
	return input*input2;
}

double Calculator::Divide( int divid, int divis )
{
   return ( divid + 0.0 ) / divis;
}
Last edited on
You have no
1
2
3
int main()
{
}


How do you propose to run your calculator without one?
Last edited on
His account now has limited functionality...probable due to posting junk in the lounge...
Registered users can post here. Sign in or register to post.