Menu

Cannot Compile, function undeclared

2008-03-06
2012-09-26
  • Nobody/Anonymous

    I keep getting an error and I don't know why. I tried searching the forums with no good answer. It compiles and runs properly in Visual Studio but not on Dev-C++. Anybody cares to help?

    include<iostream>

    include<cstdlib>

    using namespace std;

    float add(float num1, float num2)
    {
    return num1 + num2;
    }

    float minus(float num1, float num2)
    {
    return num1 - num2;
    }

    int main(void)
    {
    cout<<"Please enter a number:";
    float a;
    cin >> a;
    cout << "Please enter a number:";
    float b;
    cin >> b;
    cout << add(a, b);
    cout << minus(a, b);
    system("PAUSE");
    return 0;
    }

     
    • Jaime

      Jaime - 2008-03-26

      Are you running on Windows Vista? Because I had problems compiling C++ code in Windows Vista using Dev-C++. If you are running on Windows Vista, look for the topic where I posted a fix for it. (Sorry, can't provide a link. I can't find the topic, lol)

      -JaDe

       

Log in to post a comment.