• 📚 A new project from the admin: Check out PictureBooks.io, an AI storyteller that lets you build custom picture books for kids in seconds. Let me know what you think here!

Build error with unmodified SDK

RogerBacon

King
Joined
Nov 16, 2003
Messages
649
Hi,

I loaded up the SDK for a quick build without making any changes. Well, I got 35 errors. Most I think were caused by the conversion to VS2008 the "int" was stripped from all of the loop variables. That was pretty easy to fix. There was only one error left after that. In CvGameInterface.cpp at line 1996 "iI undeclared indetifier". Is taht code supposed to be in the loop above where iI is the loop counter? Did everyone else get these errors when using an unmodified SDK?

Code:
			for (int iI = 0; iI < GC.getNumHurryInfos(); iI++)
			{
				if (pCity->canHurry((HurryTypes)iI))
				{
					szBuffer = gDLL->getText("TXT_KEY_HURRY_PRODUCTION");

					int iHurryGold = pCity->hurryGold((HurryTypes)iI);
					if (iHurryGold > 0)
					{
						szBuffer += gDLL->getText("TXT_KEY_HURRY_PRODUCTION_GOLD", iHurryGold);
					}

					int iHurryPopulation = pCity->hurryPopulation((HurryTypes)iI);
					if (iHurryPopulation > 0)
					{
						szBuffer += gDLL->getText("TXT_KEY_HURRY_PRODUCTION_POP", iHurryPopulation);
					}

					aFlyoutItems.push_back(CvFlyoutMenuData(FLYOUT_HURRY, iI, pPlot->getX_INLINE(), pPlot->getY_INLINE(), szBuffer));
				}
			}

			if (pCity->canConscript())
			{
				UnitTypes eConscriptUnit = pCity->getConscriptUnit();
				if (eConscriptUnit != NO_UNIT)
				{
					szBuffer = gDLL->getText("TXT_KEY_DRAFT_UNIT", GC.getUnitInfo(eConscriptUnit).getDescription(), pCity->getConscriptPopulation());
					aFlyoutItems.push_back(CvFlyoutMenuData(FLYOUT_CONSCRIPT, iI, pPlot->getX_INLINE(), pPlot->getY_INLINE(), szBuffer));
				}
			}
 
Never tried to compile base BtS unmodded, but it should compile fine if you are set up properly. It compiles under 2003 rules, not 2008, so if you are not using a makefile that will cause you issues. However, this particular bit of code you post is how it is written in the DLL and it is wrong, that iI doesn't actually exist, so should not be there. Not sure what the Flyout Menu is used for, so can't say if this comes up often enough to honestly be an issue worth worrying about though. I am surprised I haven't seen it give an error before though, it really ought to.
 
Back
Top Bottom