[repost} C++ Code Block
Can someone help me what am I doing wrong here? ---------------------------------------------------------------------------------------------------- main cpp ------------------- #include <iostream> #include "MeineClassfirst.h" using namespace std; int main(){ MeineClassfirst obj; obj.myPrint(); cout << "Hello world!" << endl; return 0; } -------------------------------- MeineClassfirst.h ------------------------------- #ifndef MEINECLASSFIRST_H #define MEINECLASSFIRST_H #include <iostream> class MeineClassfirst { public: MeineClassfirst(); void myPrint(); ~MeineClassfirst(); protected: private: }; #endif // MEINECLASSFIRST_H ------------------------------------- MeineClassfirst.cpp ------------------------------------ #include "MeineClassfirst.h" #include <iostream> using namespace std; MeineClassfirst::MeineClassfirst() { cout<<"Constructor"<<endl; //ctor } void MeineClassfirst::myPrint(){ cout<<"Hello"<<endl; } MeineClassfirst::~MeineClassfirst() { cout<<"Destructor"<<endl; } -------------------------------------------------- After the run build messages shows ----------------------------- // Line// 7 undefined reference to 'MeineClassfirst::MeineClassfirst()' //Line// 8 undefined reference to 'MeinClassfirst::myPrint()' //Line// 7 undefined reference to 'MeineClassfirst::~MeineClassfirst()' //Line// 7 undefined reference to 'MeineClassfirst::~MeineClassfirst()' --------------------------------------- Thank you!