how could I link the implementation file to the header file and to the main function.
I made this program;
// This is my implementation file.. (imp.cpp)
#include <iostream>
using namespace std;
#include "CRectangle.hpp"
output()
{
cout<< "hello";
return 0;
}
// This is my header file..
#include <iostream>
using namespace std;
class CRectangle
{
public:
void output();
};
// This is my main function
#include <iostream>
using namespace std;
#include "CRectangle.hpp"
int main(void)
{
CRectangle A;
A.output();
}
:confused: The error is this:
/tmp/ccmKOGOR.o: In function `main':main.cpp:(.text+0x23): undefined reference to `CRectangle::output()'
collect2: ld returned 1 exit status
please help me... thanx in advance...