由于 rc.exe,Visual Studio 无法构建 [英] Visual Studio can't build due to rc.exe

查看:28
本文介绍了由于 rc.exe,Visual Studio 无法构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网上搜索过,但找不到与我的问题相似的任何内容.

I've searched online and couldn't find anything that resembled to my issue.

我创建了一个空的 C++ 项目并添加了一个带有返回值的 main.cpp,但我无法构建它.这是我收到的消息:

I created an empty C++ project and added a main.cpp with a return and I can't get it to build. Here is the message I receive :

1>------ Build started: Project: Project1, Configuration: Debug Win32 ------
1>LINK : fatal error LNK1158: cannot run 'rc.exe'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

VS2012 中是否有可以指定在哪里可以找到此可执行文件的地方?我已经安装了 Windows 7 SDK 并且我有这个可执行文件:

Is there somewhere within VS2012 where I can specify where to find this executable? I have installed the Windows 7 SDK and I have this executable at:

C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin

我来自 Code::Blocks 并且使用 mingw-gcc 没有任何问题,但最近我一直需要 VS 进行托管实现,所以我希望有人有想法.

I come from Code::Blocks and using mingw-gcc without any trouble, but lately I've been needing VS for managed implementations so I hope someone has an idea.

推荐答案

在 Google 上找到了这个...我假设在你的情况下你会复制 rc.exercdll.dllvisual studio 2012\vc\bin 或任何你安装它的地方:

Found this on Google... I would assume that in your case you would copy rc.exe and rcdll.dll to visual studio 2012\vc\bin or wherever you have it installed:

第 2 部分:修复链接:致命错误 LNK1158:无法运行‘rc.exe’

Part 2: FIX LINK : fatal error LNK1158: cannot run ‘rc.exe’

将此添加到您的 PATH 环境变量中:

Add this to your PATH environment variables:

C:\Program Files (x86)\Windows Kits\8.0\bin\x86

C:\Program Files (x86)\Windows Kits\8.0\bin\x86

复制这些文件:

rc.exe
rcdll.dll

rc.exe
rcdll.dll

来自

C:\Program Files (x86)\Windows Kits\8.0\bin\x86

C:\Program Files (x86)\Windows Kits\8.0\bin\x86

C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin

C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin

或者我也发现了这个:
微软从他们的 MSVT 包中遗漏了一些东西.由于没有人知道它们是被错误地遗漏还是出于许可原因,MSVC 没有人对将它们分发出去太感兴趣.一些谷歌搜索找到了一些棘手的来源.幸运的是,微软终于聪明起来并解决了这个问题以及更多问题.

Or I also found this:
Microsoft left a few things out of their MSVT package. Since no one knows whether they were left out by mistake or for license reasons, no one with MSVC is too interested in giving them out. A few Google searches turn up some tricky sources. Fortunately, Microsoft has finally wised up and solved this problem and many more.

http://msdn.microsoft.com/vstudio/express/support/faq/default.aspx#pricing

http://msdn.microsoft.com/vstudio/express/support/install/

存在大量 MSVT 丢失文件,但没有丢失 SDK 文件.

A good amount of MSVT missing files are there but the missing SDK files aren't.

还有这个:
我通过这样做解决了同样的问题:

and this:
I had the same problem which I solved by doing this:

  1. 安装 Microsoft .Net Framework 2.0
  2. 将 .NET Framework 文件的路径(对我来说是C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727")添加到全局编译器设置 > 程序 > Code::Blocks 中的其他路径.

现在我可以毫无错误地构建和链接资源文件.

Now I can build and link resource files without errors.

这篇关于由于 rc.exe,Visual Studio 无法构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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