Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

Command-line error: old for-init compatibility mode cannot be used with C++11 mode

Grant_S_
Beginner
503 Views

 

Having trouble with the error message

Command-line error: old for-init compatibility mode cannot be used with C++11 mode

We are moving an existing application compiled for win32 on an XP box with ver 11.1.067 to win10 with ver 2017.1.143

The icproj file copied across and converted on opening - apparently sucessfully

but NOTHING will compile - we just get the above error message.

Any assistance would be appreciated

=G=

 

 

 

 

 

 

0 Kudos
3 Replies
Grant_S_
Beginner
503 Views

Also, the C++11 option was turned off

G

0 Kudos
Melanie_B_Intel
Employee
503 Views

This diagnostic is given for the /Zc:forScope command line option.  Refer to the msdn page for details about the option: https://msdn.microsoft.com/en-us/library/84wcsx8x.aspx

The remedy is to remove the command line option.  Hope this helps.

--Melanie

0 Kudos
TimP
Honored Contributor III
503 Views

I've seen this old Microsoft extension used in the context of break.  It becomes impossible to know whether a variable takes outer or inner scope.  If you have not in fact used a variable defined inside the for after leaving the for scope, a working example of your problem would be needed.

0 Kudos
Reply