是否可以在 Visual Studio 2012 中使用 VC++ 6 编译器? [英] Is it possible to use the VC++ 6 compiler in Visual Studio 2012?

查看:23
本文介绍了是否可以在 Visual Studio 2012 中使用 VC++ 6 编译器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Visual Studio 2012 来开发我的项目,并且我还安装了 Visual Studio 2010 - 这使我可以选择在 Visual Studio 2012(项目属性)中使用 VC++10 编译器,但我也安装了Visual C++ 6 以及以某种方式使用 VC++6 编译器的选项在 Visual Studio 2012 中不存在,我该如何添加此选项(手动)?

解决方案

答案是肯定的.这似乎很有可能,但我无法获得 VC 6 的副本,因此我无法对其进行验证.我能够做的是让 VS 2012 使用 VC 7 (VS 2002) 来编译项目.

更新:答案是肯定的.OP 在评论中表示他能够通过使用此解决方案使 VC 6 工作.

配置

我这样做的方法是安装以下内容(按安装顺序):

Windows 7,SP1,32 位

我选择 Windows 7 是因为它是最早支持 VS 2012 的 Windows 版本.我使用了 32 位版本,因为 VS 2002 (VC7) 不会安装在 x64 机器上.

Visual Studio 2002,SP1

正如我所提到的,我无法获得 VC6.在微软的网站上找不到它.编译期间:

如您所见,正在从 VC 7 目录调用编译器 cl.exe.

最后的想法

最初的问题涉及编译现有的 VC 6 项目.只是关于这个的几个注意事项.

我的猜测是,要使重定向工作,您必须在 VS 2012 中创建一个新的空项目,然后添加所有现有的源文件.这样做的原因显然是两个版本的 Visual Studio 的项目格式不同.

正如我所提到的,我使用 VC 7 而不是 6 进行了测试.我想最后一步是让 OP 使用 VC 6 尝试所有这些.希望一切顺利.

链接

I am using Visual Studio 2012 to develop my projects, and I also have installed Visual Studio 2010 - which gives me the option to use the VC++10 compiler in Visual Studio 2012 (project properties), but I also have installed Visual C++ 6 and somehow the option to use the VC++6 compiler is not present in Visual Studio 2012, how do I add this option (manually)?

解决方案

The answer is definitely maybe. It seems quite possible, but I could not get a copy of VC 6 so I was unable to verify it. What I was able to do was to get VS 2012 to use VC 7 (VS 2002) to compile a project.

Update: The answer is definitely yes. The OP indicates in the comments that he was able to get VC 6 working by using this solution.

Configuration

The way I did this was to install the following (in order of install):

Windows 7, SP1, 32 Bit

I chose Windows 7 because it is the earliest version of Windows that will support VS 2012. I used a 32 Bit version because VS 2002 (VC7) would not install on an x64 machine.

Visual Studio 2002, SP1

As I mentioned, I could not get VC6. It was no where to be found on Microsoft's site. Bruce's comment under this question provides this helpful insight:

Visual C++ 6.0 isn't available (including via MSDN) from Microsoft because it included the Microsoft JVM. See this link for details. – BruceCran

After seeing the above, I figured that installing VS 2002 (VC 7) was the next best thing.

Obviously, this is where you would install VC 6, if you have a copy1.

1I should note, for anyone that is interested, that VC 6 is available on Ebay. If I were being paid in actual currency instead of points I would have gone the extra mile and gotten a copy of VC 6 to test.

Visual Studio 2010, SP1

The only reason for this is that it is a requirement for Daffodil. More on Daffodil below.

Visual Studio 2012, Update 2

This is a requirement from the original question.

Daffodil

This is a set of configuration files that allows VS 2010 and VS 2012 to target older VC compilers.

Currently, these are the supported VC compiler versions:

  • VC 8 (Visual Studio 2005)
  • VC 7.1 (Visual Studio 2003)
  • VC 7 (Visual Studio 2002)
  • VC 6 (Visual Studio 6)

I should note that Daffodil does not officially support VS 2012 as an IDE, but it does seem to work. From the Daffodil site:

Daffodil works fine in VS 2012 and later versions2 as long as VS 2010 is also installed.

2 There appears to be a debugging problem when using VS 2013 and VS 2015, as noted here:
Debugging information does not match, when using v60 platform toolset inside Visual Studio 2013

Testing

To test the above I created a new C++ Win 32 console project in Visual Studio 2012. I then removed all header and cpp files from the project - these have things that are VS 2012 specific, so were not needed. I then added a simple "hello world" file that I could use to test:

#include <iostream.h>

void main()
{
   cout << "Hello World!" << endl;   
}

Using the project as is (targeting VS 2012), I tried to build it and it failed.

Next, I right-clicked the project and selected properties. I selected Configuration Properties on the left side of the dialog, and then under Platform Toolset, on the right, I selected v70. You will note that there is also an option for v60:

I then saved the change to the project and did a build. It built an exe successfully. Just to verify that VC 7 was being used, I launched Process Monitor during the compile:

As you can see cl.exe, the compiler, is being called from the VC 7 directory.

Final Thoughts

The original question involves compiling an existing VC 6 project. Just a couple of notes on this.

My guess is that for retargeting to work, that you will have to create a new empty project in VS 2012, and then add in all of the existing source files. The reason for doing this is that obviously the project format is different between the two versions of Visual Studio.

As I mentioned, I tested using VC 7 instead of 6. I suppose the last step is for the OP to try all of this using VC 6. Hopefully it all works.

Links

这篇关于是否可以在 Visual Studio 2012 中使用 VC++ 6 编译器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆