I am converting a computer game project from Microsoft Visual Studio to GCC and 
get the following compiler error:

../../Human/Human.cpp: In member function ‘virtual void 
CHuman::TakeAction(CTerrainView**, PUniverse, WORD)’: 
../../Human/Human.cpp:1469:71: error: no matching function for call to 
‘CHuman::GenericAction(CDecisionNode*&, CTerrainView**&, bool, bool, bool, void 
(__attribute__((__cdecl__)) &)(IDirect3DRMFrame*, LPVOID, D3DVALUE), bool, 
NULL, void (ISoldier::*)(CTerrainView**, IPhysRendObj*, int), NULL, bool, int, 
bool)’ 
false, NULL, &ISoldier::WalkToSideOfOffering, NULL, true, 0, true ); 
^ 
../../Human/Human.cpp:1469:71: note: candidate is: 
../../Human/Human.cpp:1145:6: note: void CHuman::GenericAction(PDecisionNode, 
CTerrainView**, bool, bool, bool, PFNMOVECALLBACK, bool, PFNREACTION, 
PMFNCONTINUATION, PFNCLEANUP, bool, int, bool) 
void CHuman::GenericAction( PDecisionNode pNode, PTerrainView pView[], bool 
bHorse, 
^ 
../../Human/Human.cpp:1145:6: note:   no known conversion for argument 9 from 
‘void (ISoldier::*)(CTerrainView**, IPhysRendObj*, int)’ to ‘PMFNCONTINUATION 
{aka void (ISoldier::*)(CTerrainView**, IPhysRendObj*, int)}’

Note that in the last line, where it says "no known conversion from <argument 
1> to <argument 2>" that argument 1 and argument 2 are identical.

I did a search for "no known conversion" but there were no applicable results.

Here is the line that causes the error:

void CHuman::TakeAction( PTerrainView pView[], PUniverse pUniverse, WORD wCmdId 
) 
{ 
. . . 
    GenericAction( m_Ego.m_pCurrentDecision, pView, false, false, false, 
GenericCallback, false, NULL, 
        &ISoldier::WalkToSideOfOffering, NULL, true, 0, true ); 
. . . 
}

Here is the prototype for GenericAction:

typedef class CHuman : public CPhysicalEntity, public IHuman { 
. . . 
public: 
. . . 
    struct ego  m_Ego; 
. . . 
    void GenericAction( PDecisionNode pNode, PTerrainView pView[], bool bHorse 
= false,
        bool bThisHouse = false, bool bOffice = false, PFNMOVECALLBACK 
pfnMoveCallback = GenericCallback,
        bool bCheckForCart = true, PFNREACTION pfnReaction = NULL, 
PMFNCONTINUATION pmfnContinuation = NULL,
        PFNCLEANUP pfnCleanUp = NULL, bool bDeleteDest = true, int 
nProxScaleExp = 0, bool bSimplePath = false ); 
. . . 
} * PHomini;

Here is the prototype for WalkToSideOfOffering:

typedef class ISoldier : public IPhysRendObj { 
public: 
. . . 
    void WalkToSideOfOffering( class CTerrainView *pView[], class IPhysRendObj 
*, int nOffering = 0 ); 
. . . 
};

And here is the prototype for PMFNCONTINUATION:

typedef void (__thiscall ISoldier::*PMFNCONTINUATION)(class CTerrainView ** 
const,class IPhysRendObj *,int);

Why is there an error converting an argument from one type to an identical type?

If this is the wrong place to ask this question, please direct me to the 
appropriate place. Thank you.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply via email to