1

On windows Server 2012 I have installed Visual Studio 2015. Now I have to build Visual Studio C++ 6 based working project in VC++ 2015 but it show various errors and warnings like:

1>------ Build started: Project: Exewrap, Configuration: Debug Win32
------ 1>  Pewrap.cpp 1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include\afx.h(38): warning C4996: 'MBCS_Support_Deprecated_In_MFC': MBCS support in MFC is deprecated and may be removed in a future version of MFC. 1>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include\afx.h(33): note: see declaration of 'MBCS_Support_Deprecated_In_MFC' 1>  _WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h) 1>c:\muazzam\exewrap\Pe.h(17): warning C4200: nonstandard extension used: zero-sized array in struct/union 1>  c:\muazzam\exewrap\Pe.h(17): note: Cannot generate copy-ctor or copy-assignment operator when UDT contains a zero-sized array 1>Pewrap.cpp(291): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(205): note: see declaration of 'fopen' 1>Pewrap.cpp(517): error C2065: 'i': undeclared identifier 1>Pewrap.cpp(546): error C2065: 'i': undeclared identifier 1>Pewrap.cpp(551): error C2065: 'i': undeclared identifier 1>Pewrap.cpp(361): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name:
_stricmp. See online help for details. 1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(568): note: see declaration of 'stricmp' 1>Pewrap.cpp(362): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use
_CRT_SECURE_NO_WARNINGS. See online help for details. 1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(346): note: see declaration of 'strncpy' 1>Pewrap.cpp(364): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use
_CRT_SECURE_NO_WARNINGS. See online help for details. 1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(346): note: see declaration of 'strncpy' 1>Pewrap.cpp(365): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. 1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(568): note: see declaration of 'stricmp' 1>Pewrap.cpp(366): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(346): note: see declaration of 'strncpy' 1>Pewrap.cpp(368): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(346): note: see declaration of 'strncpy' 1>Pewrap.cpp(369): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. 1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(568): note: see declaration of 'stricmp' 1>Pewrap.cpp(370): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use
_CRT_SECURE_NO_WARNINGS. See online help for details. 1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(346): note: see declaration of 'strncpy' 1>Pewrap.cpp(372): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use
_CRT_SECURE_NO_WARNINGS. See online help for details. 1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(346): note: see declaration of 'strncpy' 1>Pewrap.cpp(403): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: see declaration of 'strcpy' 1>Pewrap.cpp(409): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(346): note: see declaration of 'strncpy' 1>Pewrap.cpp(410): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(346): note: see declaration of 'strncpy' 1>Pewrap.cpp(411): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(346): note: see declaration of 'strncpy' 1>Pewrap.cpp(412): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(346): note: see declaration of 'strncpy' 1>Pewrap.cpp(480): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: see declaration of 'strcpy' 1>Pewrap.cpp(494): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\string.h(119): note: see declaration of 'strcpy' 1>Pewrap.cpp(566): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(205): note: see declaration of 'fopen'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I didn't see any option in configuration manager for VC++6.

I think there may be some other configuration options but don't know much about that. Let me know if any one can help for it.

Further, I have to re-use code and build application using VS Studio 2015 cross platform IDE for android and IOS phones

So how to upgrade VC++6 code that should be compatible to latest version of VC++. Meanwhile this shows:

Visual Studio 2012 and Visual Studio 2013 do not support debugging applications built with Visual C++ 6; to debug these applications, use earlier versions of Visual Studio.

Should I upgrade the project from VC++6 -> VC++2010 first and subsequently build projects with upper versions or is there a direct method?

Update: The code where errors are coming is:

bool Pewrap::Process(PPROTECTIONDETAIL pDetail)
{
    LPVOID pPosition = NULL;
    LPVOID pImportBegin = NULL;
    DWORD dPosition = 0;
    DWORD dImportRva = 0;
    USERDATA SavedInfo;
    PIMAGE_IMPORT_DESCRIPTOR pImportDesc;
    PIMAGE_IMPORT_BY_NAME pImpByName;
    DWORD * ThunkPtr;
    PSIZEINFO pSize=NULL;
    PROTECTEDINFO ProtInfo;

    memset(&SavedInfo,0,sizeof(USERDATA));
    pResBase = 0;
    if(Loaded == true)
    {
        CloseFile();
    }
    if(Loaded == false)
    {
        if(LoadFile(EXTRASIZE)==false)
        {
            return false;
        }
    }
    if(pDetail->ProtType == PROTECTION_STRONG)
    {
        UseVGCrypt = 1;
        SavedInfo.ProtType = PROTECTION_STRONG;
    }
    else
    {
        UseVGCrypt = 0;
        SavedInfo.ProtType = PROTECTION_MEDIUM;
    }

    unsigned char ProdId[PROD_ID_LEN];
    memset(ProdId,0,sizeof(ProdId));

    if(GetProtectedInfo(pDetail->Destination,&ProtInfo)==false)
    {
        GenRsaPrime((DIGIT_T*)ProdId,MOD_SIZE);
        ProdId[0]= ProdId[0] & RSA_MESSAGE_HIGHBIT_MASK;    // needed for rsa algorithm. 

    }
    else
    {
        memcpy(ProdId,ProtInfo.prodid,PROD_ID_LEN);
        if(stricmp(pDetail->Author,"None")==0)
            strncpy(pDetail->Author,ProtInfo.Author,sizeof(pDetail->Author));
        else
            strncpy(ProtInfo.Author,pDetail->Author,sizeof(ProtInfo.Author));
        if(stricmp(pDetail->Title,"None")==0)
            strncpy(pDetail->Title,ProtInfo.Title,sizeof(pDetail->Title));
        else
            strncpy(ProtInfo.Title,pDetail->Title,sizeof(ProtInfo.Title));
        if(stricmp(pDetail->PubDate,"None")==0)
            strncpy(pDetail->PubDate,ProtInfo.PublishDate,sizeof(pDetail->PubDate));
        else
            strncpy(ProtInfo.PublishDate,pDetail->PubDate,sizeof(ProtInfo.PublishDate));
    }

    SetProtectedInfo(&ProtInfo,pDetail,ProdId);

//  GenRsaPrime((DIGIT_T*)ProdId,MOD_SIZE);
//  ProdId[0]= ProdId[0] & RSA_MESSAGE_HIGHBIT_MASK;    // needed for rsa algorithm. 


    memcpy(Key,ProdId,PROD_ID_LEN);

    if(pDetail->TestMode == FALSE)
    {
        RSACTX pubctx,prictx;
        SavedInfo.TestMode = 0;
        GetRsaCtx(&pubctx,(char*)pubcrykey,0);

        RsaCrypt(&pubctx,(char*)ProdId,sizeof(ProdId));
        memcpy(SavedInfo.ProductId,ProdId,PROD_ID_LEN);


    }
    else
    {
        SavedInfo.TestMode = 1;
        memcpy(SavedInfo.ProductId,ProdId,PROD_ID_LEN);
    }

    memset(pDetail->ProdId,0,sizeof(pDetail->ProdId));
    if(pDetail->TestMode == TRUE)
    {
        strcpy(pDetail->ProdId,"None");
    }
    else
    {
        BinToHex((char*)SavedInfo.ProductId,PROD_ID_LEN,pDetail->ProdId);
    }
    strncpy(SavedInfo.Author,pDetail->Author,sizeof(SavedInfo.Author)-1);
    strncpy(SavedInfo.Title,pDetail->Title,sizeof(SavedInfo.Title)-1);
    strncpy(SavedInfo.PublishDate,pDetail->PubDate,sizeof(SavedInfo.PublishDate)-1);
    strncpy(SavedInfo.RegUrl,pDetail->RegUrl,sizeof(SavedInfo.RegUrl)-1);
    if(pDetail->FreeWare == TRUE)   
    {
        SavedInfo.FreeWare = 1;
    }
    else
    {
        SavedInfo.FreeWare = 0;
    }

    if(UseVGCrypt)
    {
        VGInit(&ctx,Key,KEYLEN);
    }

    PIMAGE_SECTION_HEADER pSecHdr = GetLastSection();
    DWORD align=pImage->OptionalHeader.SectionAlignment;

    if(Length < (pSecHdr->PointerToRawData+pSecHdr->SizeOfRawData))
    {
        AfxMessageBox("Actual File Length is less than What is said in Header.\n"
            "The File Might be corrupt.");
        return false;
    }

    if(Length > (pSecHdr->PointerToRawData+pSecHdr->SizeOfRawData))
    {
        DWORD Size = Length - (pSecHdr->PointerToRawData+pSecHdr->SizeOfRawData);
        if(pSecHdr->Misc.VirtualSize < (pSecHdr->SizeOfRawData+Size))
        {
            pSecHdr->Misc.VirtualSize=pSecHdr->SizeOfRawData+Size;
            pSecHdr->Misc.VirtualSize= ((pSecHdr->Misc.VirtualSize / align) * align) + align;
            pImage->OptionalHeader.SizeOfImage=pSecHdr->VirtualAddress+pSecHdr->Misc.VirtualSize;
        }
        pSecHdr->SizeOfRawData += Size;
    }

    pPosition = GetWritePointer();
    if(pPosition == NULL)
        return false;
    dPosition = pSecHdr->VirtualAddress + pSecHdr->SizeOfRawData;

    memcpy((char*)pPosition,asmStub,sizeof(asmStub));
    pPosition = ADDPTR(LPVOID,pPosition,sizeof(asmStub));

    pSize = (PSIZEINFO)pPosition;

    pPosition = ADDPTR(LPVOID,pPosition,sizeof(SIZEINFO));
    dPosition += sizeof(asmStub)+sizeof(SIZEINFO);

    pImportBegin = pPosition;

    IMAGE_DATA_DIRECTORY NullDirectory = { 0,0 };
    SavedInfo.ImportDataDirectory = pImage->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT];
    SavedInfo.TlsDataDirectory = pImage->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_TLS];
    SavedInfo.BoundImportDirectory = pImage->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT];

    pImage->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_TLS] = NullDirectory;
    pImage->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT] = NullDirectory;

    pImportDesc =(PIMAGE_IMPORT_DESCRIPTOR) pPosition;
    pImportDesc->ForwarderChain = 0;
    pImportDesc->TimeDateStamp = 0;

    dPosition+= sizeof(IMAGE_IMPORT_DESCRIPTOR)*2;
    pImportDesc->Name = dPosition ;

    pPosition = ADDPTR(LPVOID,pPosition,(sizeof(IMAGE_IMPORT_DESCRIPTOR) *2));
    strcpy((char*)pPosition,KERNEL32);
    pPosition = ADDPTR(LPVOID,pPosition,sizeof(KERNEL32));
    dPosition+=sizeof(KERNEL32);

    pImportDesc->FirstThunk = dPosition;
    ThunkPtr = (DWORD*) pPosition;

    pPosition = ADDPTR(LPVOID,pPosition,(NO_OF_FUNCTIONS +1)* sizeof(IMAGE_THUNK_DATA));
    dPosition += ((NO_OF_FUNCTIONS +1)* sizeof(IMAGE_THUNK_DATA));

    for(int i=0;i<NO_OF_FUNCTIONS;i++)
    {
        pImpByName = (PIMAGE_IMPORT_BY_NAME)pPosition;
        pImpByName->Hint=0;
        strcpy((char*)pImpByName->Name,FunctionArray[i]);
        *ThunkPtr = dPosition;
        ThunkPtr++;
        pPosition = ADDPTR(LPVOID,pPosition,(sizeof(WORD) + strlen(FunctionArray[i])+1));
        dPosition += (sizeof(WORD) + strlen(FunctionArray[i])+1);
    }

    *ThunkPtr = 0;
    pImportDesc++;
    memset(pImportDesc,0,sizeof(IMAGE_IMPORT_DESCRIPTOR));

    dImportRva = pSecHdr->VirtualAddress + pSecHdr->SizeOfRawData + SUBPTR(DWORD,pImportBegin,GetWritePointer());

    DWORD ImportSize = SUBPTR(DWORD,pPosition,pImportBegin);
    pImage->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].Size = ImportSize;
    pImage->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress = dImportRva;

    SavedInfo.OriginalEntryPoint = pImage->OptionalHeader.AddressOfEntryPoint;

    pImage->OptionalHeader.AddressOfEntryPoint = pSecHdr->VirtualAddress + pSecHdr->SizeOfRawData;

    PIMAGE_SECTION_HEADER pSecHdrTmp;
    pSecHdrTmp = pImage->SectionHeader;
    for(i=0;i<pImage->FileHeader.NumberOfSections;i++)
    {
        pSecHdrTmp->Characteristics = 0xe0000060;
        pSecHdrTmp++;
    }

    DWORD IncreasedSize = SUBPTR(DWORD,pPosition,GetWritePointer());
    DWORD ExtendedMapSize = IncreasedSize;

    pSize->ImportDataSize = ImportSize;
    pSize->UserDataSize = sizeof(USERDATA);
    pSize->DllDataSize = sizeof(rawData);

    IncreasedSize+= pSize->UserDataSize;
    IncreasedSize+= pSize->DllDataSize;

    IncreasedSize+= sizeof(PROTECTEDINFO);


    if(pSecHdr->Misc.VirtualSize < (pSecHdr->SizeOfRawData+IncreasedSize))
    {
        pSecHdr->Misc.VirtualSize=pSecHdr->SizeOfRawData+IncreasedSize;
        pSecHdr->Misc.VirtualSize= ((pSecHdr->Misc.VirtualSize / align) * align) + align;
        pImage->OptionalHeader.SizeOfImage=pSecHdr->VirtualAddress+pSecHdr->Misc.VirtualSize;
    }

    pSecHdr->SizeOfRawData += IncreasedSize;
    PIMAGE_SECTION_HEADER pEncSecHdr = pImage->SectionHeader;

    for(i=0;i<pImage->FileHeader.NumberOfSections;i++)
    {
        if(CanEncryptSection(pEncSecHdr))
        {
            EncryptSection(pEncSecHdr);
            SavedInfo.EncryptedSections = SavedInfo.EncryptedSections | (0x80000000 >> i);
        }
        pEncSecHdr++;
    }

    if(CanEncryptResourceSection())
    {
        EncryptResourceSection();
        SavedInfo.ResourceEncrypted = RESOURCE_IS_INCRYPTED;
    }

//  DWORD temp = MapSize;
//  MapSize = Length + IncreasedSize;
//  SaveCopy("out.exe");

    FILE * f=fopen((LPCTSTR)pDetail->Destination,"wb");
    if(f==NULL)
    {
        CString msg;
        msg.Format("Could not open %s for output",pDetail->Destination);
        AfxMessageBox(msg);
        return false;
    }
    fwrite((char*)pBase,Length+ExtendedMapSize,1,f);

    DWORD Temp = UseVGCrypt = 0;
    memcpy(Key,GlobalKey,KEYLEN);
    EncryptData(&SavedInfo,sizeof(USERDATA));
    UseVGCrypt = Temp;

    fwrite((char*)&SavedInfo,sizeof(USERDATA),1,f);
    unsigned char * rd = new unsigned char[sizeof(rawData)];
    memcpy(rd,rawData,sizeof(rawData));
    CryptRawData(rd,sizeof(rawData));
    fwrite(rd,sizeof(rawData),1,f);
    delete rd;

    fwrite(&ProtInfo,sizeof(ProtInfo),1,f);

    fclose(f);

    return true;

}   
Muhammad Muazzam
  • 2,810
  • 6
  • 33
  • 62
  • Without any changes? Pretty much. Languages do change. Someone ignored maintenance, now pay the price. – TomTom Mar 20 '16 at 09:31
  • Why do you have to build it in visual studio 2015? Just install visual c++ 6 in a VM capable of running it. – zeromus Mar 20 '16 at 11:01
  • @zeromus I have to build cross-platform application using VS 2015 – Muhammad Muazzam Mar 20 '16 at 15:00
  • define cross-platform – zeromus Mar 20 '16 at 23:19
  • @zeromus question edited – Muhammad Muazzam Mar 21 '16 at 09:38
  • Alright. next step is to forget android and get it building in vs2015 for PC target. Good luck. Youll have to solve each one of the 100000 error messages. No magic bullet. – zeromus Mar 21 '16 at 10:09
  • More details on problem is needed - this is too generic question. There are thousands and thousands problems which can raise because of platform cross portability. And some of compile warnings it's possible to enabling some define - for example. But it depends on actual problem. Please provide more details ! – TarmoPikaro Mar 26 '16 at 11:47
  • @TarmoPikaro I would like to run VC++6code on VC++2015 – Muhammad Muazzam Mar 28 '16 at 08:45
  • again - depends on warnings / errors which you have. For example - this is one of problems I haven't switching to vs2015: http://stackoverflow.com/questions/35805113/visual-studio-2015-run-time-dependencies-or-how-to-get-rid-of-universal-crt - but I think it's not what you were looking for right ? Describe your problems in more details ?! – TarmoPikaro Mar 28 '16 at 09:56
  • If the only errors in your code are coming from VC++6’s non-standard scoping of identifiers declared in a `for` statement initialiser, a quick fix might be the option [**/Zc:forScope-**](https://msdn.microsoft.com/library/84wcsx8x(v=vs.140).aspx "MSDN") – Brian Nixon Mar 29 '16 at 18:05
  • @BrianNixon That's already configured – Muhammad Muazzam Mar 30 '16 at 06:05
  • 1
    I don't advise solving those kinds of problems with compile flags. In the condition you're in, that kind of stuff is just as likely to make new bugs as solve them. Just fix the code. You have an astoundingly low number of distinct errors (1). It should take about 2 seconds to fix. Any C programmer can do it. – zeromus Apr 01 '16 at 05:57

3 Answers3

1

The _CRT_SECURE_NO_WARNINGS are just that - warnings - your code will still compile (and be no less secure than it was when it was compiled in VC++6). The only errors you have (from your output) are in the form:

 Pewrap.cpp(551): error C2065: 'i': undeclared identifier

I am going to assume that 'i' is a for loop index variable, and that your VC++6 project used Microsoft Language Extensions, so that loop variables declarations persisted after the loop. I'm also going to guess that in your VS2015 project, Disable Language Extensions /Za (Property Pages->C/C++->Language) is on, thus, the first loop where 'i' is used works, and the rest give errors. Either don't disable the language extensions, or, declare 'i' in every loop you use it in (or at a higher scope).

Declaring 'i' properly is the most portable method, as it doesn't rely on any language extensions. Eg. you have this:

for(int i=0;i<NO_OF_FUNCTIONS;i++)
...
for(i=0;i<pImage->FileHeader.NumberOfSections;i++)
...

Changing the first usage of 'i' to simply:

int i;
for(i=0;i<NO_OF_FUNCTIONS;i++)
MuertoExcobito
  • 9,741
  • 2
  • 37
  • 78
0

Select project in Solution explorer, right click - Properties. C/C++ > Preprocessor.

Repeat this step for all configurations / all platforms, by changing configuration (Debug / Release) / platform (x86 / x64) from top dropboxes, and saving configuration for each configuration / platform.

Edit preprocessor definitions. Add following define '_CRT_SECURE_NO_WARNINGS' - it will disable function compatibility warning.

TarmoPikaro
  • 4,723
  • 2
  • 50
  • 62
0

The only messages that you show are harmless warnings. Contrary to one of your comments, they do go away when you define _CRT_SECURE_NO_WARNINGS. If not, you didn't define the symbol properly or for the right files.

I see the mention of an 'i': undeclared identifier error in another post, but not in your abstract. If the latter arises, this is indeed a change in the scoping rules of within-for-loop variable declarations, which is managed with the /Zc option (C++ / Language / Force Conformance in For Loop Scope).