Quantcast
Viewing all articles
Browse latest Browse all 22070

Migrating code from OpenVMS to Linux with GCC compiler -> Error: ClassName::Func() is private

We have a legacy code that used to be compiled and run with no errors under Open-VMS environment, using CXX compiler. We decided to migrate to Linux, and to use GCC compiler, so we copied the code and tried to compile one file but gave the error:

formint.h:106:17: error: int FI::CFormInt::ExecIntBinOp(FI::CSymbol*, FI::CSymbol*, FI::CFormInt::m_enumBinOp) is private
     int         ExecIntBinOp(CSymbol* pV0,CSymbol* pV1,m_enumBinOp eBO);
                 ^

Here is a minified version of the code in the file, for the purpose of this question:

class CSymbol;   // forward declaration

class DECLSPEC CFormInt {
    public:
        CFormInt(const char* szExpression="",int bCaseSensitive=1,int iMaxSymbols=1000);
        Interpret(const char* szExpression);
        // all public stuff here

    protected:
        // protected stuff here

    private:
        int ExecIntBinOp(CSymbol* pV0,  CSymbol* pV1,   m_enumBinOp eBO);
}

class DECLSPEC CSymbol {
   public:
      // stuff
   private:
      friend int CFormInt::ExecIntBinOp(CSymbol* ,CSymbol* ,m_enumBinOp);
}

I already know what private vs public entail, but the code used to compile fine under OpenVMS CXX compiler without this complaint.

What could be done to overcome this issue?


Viewing all articles
Browse latest Browse all 22070

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>