View Full Version : [sdk Compiling Problem] C2660


Grave
Apr 27, 2007, 11:15 PM
When compiling, I'm getting these errors:


Project : CvGameCoreDLL
Compiler : Microsoft Visual C++ Toolkit 2003 (called directly)
Directory : C:\Games\Sid Meier's Civilization 4\Warlords\CvGameCoreDLL\
--------------------------------------------------------------------------------
Switching to target: Final Release
CvSelectionGroup.cpp
cvselectiongroup.cpp(1242) : error C2660: 'CvSelectionGroup::groupAttack' : function does not take 3 arguments
cvselectiongroup.cpp(4154) : error C2660: 'CvSelectionGroup::AI_getBestGroupAttacker' : function does not take 2 arguments
Process terminated with status 1 (0 minutes, 4 seconds)
2 errors, 0 warnings



The error I'm getting is with Dale's Combat Mod. I'm trying to merge it with Better AI.

Here is the code around line 1242:


// Grave's ModComp Dale - Stack Attack: use required group attack method whether concept on or off
if(DCMStackAttack)
{
if (groupStackAttack(headMissionQueueNode()->m_data.iData1, headMissionQueueNode()->m_data.iData2, headMissionQueueNode()->m_data.iFlags))
{
bDone = true;
}
} else {
if (groupAttack(headMissionQueueNode()->m_data.iData1, headMissionQueueNode()->m_data.iData2, headMissionQueueNode()->m_data.iFlags))
{
bDone = true;
}
}


Here is the code around line 4154:


if (getNumUnits() > 0)
{
if ((getDomainType() == DOMAIN_AIR) || (stepDistance(getX(), getY(), pDestPlot->getX_INLINE(), pDestPlot->getY_INLINE()) == 1))
{
if ((iFlags & MOVE_DIRECT_ATTACK) || (getDomainType() == DOMAIN_AIR) || (generatePath(plot(), pDestPlot, iFlags) && (getPathFirstPlot() == pDestPlot)))
{
if (AI_getBestGroupAttacker(pDestPlot, true) != NULL)
{
if (groupDeclareWar(pDestPlot))
{
return true;
}



Any ideas? I'll try and provide more details if needed.

Grave
Apr 27, 2007, 11:18 PM
For the time being, I put a // in front of lines 1242 and 4154 and it seems to be compiling fine now. The DCM code that's giving me troubles involves stacked combat, which I probably won't even use anyway.

Gerikes
Apr 27, 2007, 11:36 PM
Project : CvGameCoreDLL
Compiler : Microsoft Visual C++ Toolkit 2003 (called directly)
Directory : C:\Games\Sid Meier's Civilization 4\Warlords\CvGameCoreDLL\
--------------------------------------------------------------------------------
Switching to target: Final Release
CvSelectionGroup.cpp
cvselectiongroup.cpp(1242) : error C2660: 'CvSelectionGroup::groupAttack' : function does not take 3 arguments
cvselectiongroup.cpp(4154) : error C2660: 'CvSelectionGroup::AI_getBestGroupAttacker' : function does not take 2 arguments
Process terminated with status 1 (0 minutes, 4 seconds)
2 errors, 0 warnings





The errors say that the groupAttack function does not take three arguments. You're passing groupAttack three arguments, but the error message says that the function is expecting a different amount. Looking at the SDK I have, groupAttack truly does only want three arguments, so I'm guessing perhaps Dale modified the groupAttack function arguments? Check out CvSelectionGroup.h and see what the groupAttack function declaration looks like.


I think the same thing goes for CvSelectionGroup::AI_getBestGroupAttacker. Check out what that function looks like in the CvSelectionGroupAI.h file.

Edit:

BTW, groupAttack typically has three arguments in Vanilla, not sure about WL.

Grave
Apr 27, 2007, 11:38 PM
Cool, thanks. I'll look into it. I may just end up removing all of Dale's Stacked Combat anyway.

It's odd, because with the regular 2.08 files this compiles no problem. But when you try and merge it with Better AI you get this error.