Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
7568 Discussions

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

Grant_S_
Beginner
180 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
180 Views

Also, the C++11 option was turned off

G

Melanie_B_Intel
Employee
180 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

TimP
Black Belt
180 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.

Reply