Day 6 of 21
My objective: To compile and execute a program which uses my custom "math class" for basic math functions
My problem: I am getting a compiler error (take a look at the exact compile error I have included at the bottom of this thread)
Here is the code of my three files (Main.cpp, MikesMath.h, MikesMath.cpp):
Main.cppMikesMath.hCode:#include <iostream> #include "MikesMath.h" using namespace std; int main() { cout << "Hello: " << add(2,2) << endl; system("PAUSE"); return 0; }
MikesMath.cppCode:#ifndef MIKESMATH_H_ #define MIKESMATH_H_ class MikesMath { public: MikesMath(); ~MikesMath(); int add(int x, int y); int multiply(int x, int y); }; #endif
Here is what my compiler (GCC compiler/Using DevC++) is spitting at me:Code:#include "MikesMath.h" int MikesMath::add(int x, int y) { return x + y; } int MikesMath::multiply(int x, int y) { return x * y; } MikesMath::MikesMath() { } MikesMath::~MikesMath() { }
Image:
http://img543.imageshack.us/img543/8...pilererror.png



LinkBack URL
About LinkBacks




