简体   繁体   中英

Visual Studio Compiler Configuration Options

I have recently inherited an old c++ project built in visual studio 2003 that consists of a lot of code that looks like this:

for(int i=7;i<40;i++)
    title[i-7]=temp_title[i];
for(i=33;i<80;i++)
    title[i] = ' ';

However, since I do not have VS2003, I installed 2008 and now I am running into a lot of compilation errors due to i being an undeclared identifier since its out of scope. I am a complete novice to visual studio, how do I configure my project so it uses whatever compatible c++ compiler for 2003 so I can build the project and see what the heck its supposed to do.

@Kirill V. Lyadvinsky

Yes, I do plan to fix the code, however, I'd like to have a base version that I can use to test against in case I mess something up since the person who wrote this is now retired (thankfully)

You could use an option /Zc:forScope (Force Conformance in for Loop Scope) . Switch it off as in the picture below. But I'd strongly recommend to fix the code so it will be conformant with current C++ Standard.

图片:200

/Zc:forscope-是您似乎正在寻找的东西。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM