Hi I am in the process of porting an 8 yr old program from a a Linux PC kernal 1.3.45 to a newer PC with RH 7.1. When I recompile the program I get the error
"ISO C++ forbids declaration of `CommandSetup' with no type."
I am not sure how to clear this problem, on the old compiler it compiles fine.
Any assistance would be appreciated
a sample of the code:
two header files
// session.h
//
#ifndef __SESSION_H__
#define __SESSION_H__
class CSession
{
public:
virtual int ReserveChannels() = 0;
virtual int CommandSetup(char *pszResponse = NULL, int nRespLen = 0) = 0;
protected:
char m_szGateway[MAXINPUT]; // Gateway address
};
#endif // __SESSION_H__
_______________________________________
// dacsiv.h
//---------------------------------------------------------------------------------
#include "session.h"
// CDACSIVSession is the DACS-IV specific implementation of CSession.
class CDACSIVSession : public CSession
{
public:
virtual int ReserveChannels();
virtual int CommandSetup(char *pszResponse, int nRespLen);
};
=============================
the. cpp file
// dacsiv.cpp
//------------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream.h>
#include <sys/types.h>
#include "scanini.h"
#ifndef WIN32
#include "reserver.h"
#endif
#include "asert.h"
#include "dacsiv.h"
#include "misc.h"
// The constructor merely references the parameterized CSession constructor.
CDACSIVSession::CommandSetup(char *pszResponse, int nRespLen)
{
switch (m_nCommand)
{
case RTRV_T1:
return RTRVSetup(pszResponse, nRespLen);
case CONN_TACC_T1:
return TACCSetup();
case OPR_LPBK_T1:
return LPBKSetup();
case PROV_T1:
return PROVT1();
}
return 0;
}
"ISO C++ forbids declaration of `CommandSetup' with no type."
I am not sure how to clear this problem, on the old compiler it compiles fine.
Any assistance would be appreciated
a sample of the code:
two header files
// session.h
//
#ifndef __SESSION_H__
#define __SESSION_H__
class CSession
{
public:
virtual int ReserveChannels() = 0;
virtual int CommandSetup(char *pszResponse = NULL, int nRespLen = 0) = 0;
protected:
char m_szGateway[MAXINPUT]; // Gateway address
};
#endif // __SESSION_H__
_______________________________________
// dacsiv.h
//---------------------------------------------------------------------------------
#include "session.h"
// CDACSIVSession is the DACS-IV specific implementation of CSession.
class CDACSIVSession : public CSession
{
public:
virtual int ReserveChannels();
virtual int CommandSetup(char *pszResponse, int nRespLen);
};
=============================
the. cpp file
// dacsiv.cpp
//------------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream.h>
#include <sys/types.h>
#include "scanini.h"
#ifndef WIN32
#include "reserver.h"
#endif
#include "asert.h"
#include "dacsiv.h"
#include "misc.h"
// The constructor merely references the parameterized CSession constructor.
CDACSIVSession::CommandSetup(char *pszResponse, int nRespLen)
{
switch (m_nCommand)
{
case RTRV_T1:
return RTRVSetup(pszResponse, nRespLen);
case CONN_TACC_T1:
return TACCSetup();
case OPR_LPBK_T1:
return LPBKSetup();
case PROV_T1:
return PROVT1();
}
return 0;
}