--- In [email protected], "Brett McCoy" <[EMAIL PROTECTED]> wrote: > > On Mon, Mar 24, 2008 at 7:10 AM, pat.morgan74 <[EMAIL PROTECTED]> wrote: > > > I am stuck with a simple problem.Its eating fri=om with in > > > > My code is as below > > in the file where main is > > > > #include class.h > > int main() > > { > > classa ex; > > > > } > > > > in .h file > > class classa > > { > > classa(); > > ~classa(); > > > > }; > > > > in the .cc file > > #include class.h > > classa::classa() > > {} > > classa::~classa() > > {} > > > > But g++ is throwing an error in main "undefined reference to > > classa::classa()" > > whats am i doing wrong? > > It seems like a linking problem. How are you compiling these files? > With a makefile?
One more thing, why is the constructor/destructor private? Doesn't look like you are trying to create a singleton in main(). Regards, Saurabh
