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?