简体   繁体   English

将VC ++ 6.0转换为VC ++ 2005

[英]Converting VC++ 6.0 to VC++ 2005

I have converted a C++ program written for VC++ 6.0 to VC++ 2005 with Visual Studio 2005. 我已经使用Visual Studio 2005将为VC ++ 6.0编写的C ++程序转换为VC ++ 2005。

This raises a lot of errors because VC++ 2005 is somehow more "strict" than 6.0. 由于VC ++ 2005在某种程度上比6.0更加“严格”,因此会引发很多错误。

There are two possible solutions I can think of, but I don't know if it is possible. 我可以想到两种可能的解决方案,但我不知道是否可能。

Is it possible to change the level of "strictness" in VS2005, so the application can be compiled with VC++ 2005? 是否可以在VS2005中更改“严格”级别,以便可以使用VC ++ 2005编译应用程序?

When developing a .NET-application it is possible to change the .NET-framework version for a specific application. 开发.NET应用程序时,可以为特定应用程序更改.NET-framework版本。 Is this possible in for VC++ (Switching from 2005 to 6.0 after I have upgraded the solution)? 对于VC ++,这是否可行(在升级解决方案后从2005切换到6.0)?

I am new to VC++, so I'm "Learning while Programming". 我是VC ++的新手,所以我是“边学习边编程”。

VS 2005 does not let you "compile as" an older compiler version. VS 2005不允许您“编译为”较旧的编译器版本。 VS 2012 allows you to compile as VS 2010, but that is the first time VS has had such a feature. VS 2012允许您像VS 2010一样进行编译,但这是VS首次具有此功能。

If you want to upgrade a project to VS 2005, you will have to just bite the bullet and fix the problems. 如果要将项目升级到VS 2005,则只需硬着头皮解决问题。 But that's a good thing! 但这是一件好事! In my experience the "stricter" compiler really has pointed bugs in the original code. 以我的经验,“严格”编译器确实在原始代码中指出了错误。

While you're going through the pain of upgrading your compiler, you should jump to the latest (VS 2012) if that's an option. 在经历升级编译器之苦时,如果可以的话,您应该跳至最新版本(VS 2012)。


Aside: In .NET you are targeting a particular .NET version, because the end user may have a different .NET version installed on their computer. 补充:在.NET中,您的目标是特定的.NET版本,因为最终用户的计算机上可能安装了不同的.NET版本。 But with C++, you are "targeting" x86 or x64, not a particular compiler. 但是,使用C ++,您将“瞄准” x86或x64,而不是特定的编译器。

The very first time when you will open the project written in Visual studio 6.0 into Visual studio 2005 the IDE will convert the project and report the errors. 第一次将Visual Studio 6.0中编写的项目打开到Visual Studio 2005中时,IDE会转换该项目并报告错误。

It will list down all the errors and warnings in the conversion report and display it to you. 它将在转换报告中列出所有错误和警告,并向您显示。

You won't be able to successfully build your project until unless you remove all these errors. 除非您删除所有这些错误,否则您将无法成功构建项目。 However, you can change the setting to bend this rule so that only selected list of errors can be displayed. 但是,您可以更改设置以弯曲此规则,以便仅显示选定的错误列表。

Follow the below steps to do so : 1) Open the visual studio 6.0 project in Visual studio 2005 project. 请按照以下步骤操作:1)在Visual Studio 2005项目中打开Visual Studio 6.0项目。 2) Go to Tools menu item in Visual studio menu. 2)转到Visual Studio菜单中的“工具”菜单项。 3) Go to Options Menu item. 3)转到选项菜单项。 4) Go to Performance Tools. 4)转到性能工具。 5) Go to Rules. 5)转到规则。 you will find the list of all the errors/warning and how they need to be reported. 您将找到所有错误/警告以及如何报告这些错误/警告的列表。 You may change the actions as per your convenience. 您可以根据需要更改操作。

I hope this information will be useful to you. 希望这些信息对您有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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