I have a pretty syntax-correct and very simple app that takes two integers from user and do substraction and addition of them. But when i try to compile a program, i'm getting this error:
Could not find 'C:\Users\MyUsername\source\repos\SimpleCalculator\SimpleCalculator\Debug\SimpleCalculator.obj'. SimpleCalculator.exe was built with /DEBUG:FASTLINK which requires object files for debugging.
Here is my code:
#include "stdafx.h"
#include <iostream>
using namespace std;
void main()
{
int a, b;
cout << "Welcome." << endl;
cout << "Enter first number: ";
cin >> a;
cout << "Enter second number: ";
cin >> b;
cout << "A+B is: ";
cout << addition(a,b) << endl;
cout << "A-B is: ";
cout << substraction(a,b) << endl;
system("pause");
}
int addition(int a, int b) {
return a + b;
}
int substraction(int a, int b) {
return a - b;
}
This error only happens when i have functions. When my code is like:
cout << "A+B is: ";
cout << a+b << endl;
there is no errors.