I have problem compiling this program using GCC(g++)
//bye.h --header file
#ifndef BYE_H
#define BYE_H
void display();
#endif
//bye.C -------- Source
#include "bye.h"
#include <iostream.h>
void display()
{
cout <<"Display the stuff ";
}
//main.cpp -----source
#include <iostream.h>
#include <string.h>
#include "bye.h"
class myclass
{
//mystruct x;
friend void display();
public:
myclass(){
display();
}
};
int main()
{
myclass me;
}
If I compile using g++ main.cpp I get the following error,
/tmp/ccG3OvUb.o: In function `myclass::mycla ss[in-charge]()':
/tmp/ccG3OvUb.o(.gnu .linkonce.t._ZN 7myclassC1Ev+0x 7): undefined
reference to `display()'
collect2: ld returned 1 exit status
Can some body explain how to do it
thanks in advance,
Seema Rao