Microsoft VC++2015 not compatible with VC++6, was: QT iStart and iSymbol errors

I started to use QT data plugin as starting point for my Data Plugin.

I am using VS2015. converted the project to VS 2015. it is showing the following errors.

iStart unidentified.
iSymbol unidnetified

Both the variables were used in a For loop and are used outside the for loop.

Whether I need to declare the same as global variable ?

struct RecentInfo *FindOrAddRecentInfo( LPCTSTR pszTicker )
{
	struct RecentInfo *ri = NULL;

	if( g_aInfos == NULL ) return NULL;

	for( int iSymbol = 0; g_aInfos && iSymbol < RecentInfoSize && g_aInfos[ iSymbol ].Name && g_aInfos[ iSymbol ].Name[ 0 ]; iSymbol++ )
	{
		if( ! stricmp( g_aInfos[ iSymbol ].Name, pszTicker ) )
		{
			ri = &g_aInfos[ iSymbol ];
			return ri;	// already exists - do not need to add anything
		}
	}

	if( iSymbol < g_nSymbolLimit )
	{
		if( AddToQTPortfolio( pszTicker ) )
		{
			GrowRecentInfoIfNecessary( iSymbol );
			ri = &g_aInfos[ iSymbol ];
			strcpy( ri->Name, pszTicker );
			ri->nStatus = 0;
		}
	}

	return ri;
}

No. The variable must be local. The code was written in Visual C++ 6.0 which kept variables declared in for statement visible later (after the for end). But newer versions of Visual C++ behave differently.
So instead of

for( int iSymbol = 0; ... the rest )

you need to use

int iSymbol = 0;
for( iSymbol = 0; ... the rest
3 Likes

Thank you @Tomasz. It is compiling now. I also modified Post Build Command line which copies the Plugin to Amibroker Plugins folder.