functions abstract?

Arne Christensen arc@pine.dk
Thu, 27 Nov 1997 11:53:37 +0100 (MET)


Abdullah Bushnaq writes:

> I am compiling an IDL file that has the following defintion:
> 
> Interface Finder 
> 	{
> 		void find (inout short i);
> 	};
> 
> In my Finder_i.cc file that contains the implementation I have only
> defined the following:
> 
> void find (short &i)
> 	{
> 		cout << i;
> 	}
> 
> So obviously I don't have all of my code in, but whenever I try to
> compile the project I get the following error:
> 
> libfind.cc: In function `int main(int, char **)':
> libfind.cc:31: cannot allocate an object of type `Finder_i'
> libfind.cc:31:   since the following virtual functions are abstract:
> libfind.cc:31:  void _sk_Finder::Find(short int &)
> make: *** [libfind.o] Error 1

Try with

void Finder_i::find (short &i)
	{
		cout << i;
	}

You need to tell the compiler that it's a member function of the
Finder_i class that you're implementing, not a global function.

By the way, I guess your function is called "Find" rather than "find";
that what the compiler thinks, at least.

----
Arne Christensen
Pine Tree Systems A/S,  Snedkervej 12,  DK-2630 Taastrup,  Denmark
Email: arc@pine.dk       Fax: +45 43 71 43 42       Voice: +45 43 71 07 04