help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Compilation difference between VC++ and G++


From: smsabu2002
Subject: Compilation difference between VC++ and G++
Date: 9 Jun 2006 07:30:55 -0700
User-agent: G2/0.2

Hi,


I try to call a function implemented in the Baseclass from the
DerivedClass.

When i compiled it using VC++, the following Error was thrown
"illegal Call to non-static member BaseClass::function() "
But, it gets compiled with  g++ in Solaris.

What could be the problem.

================
class BaseClass
{
    void function() { cout<<"Inside Base Class"<<endl; } }

class DerivedClass : public::BaseClass
{
    void function();
}

DerivedClass::function()

{
    cout<<"Inside Derived Class"<<endl;
     BaseClass::function();
}
==========

Thanks in advance.

Arun.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]