Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
592 views
in Technique[技术] by (71.8m points)

Visual Studio can't build due to rc.exe

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

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 ==========

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 FilesMicrosoft SDKsWindowsv7.0Bin

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.

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

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

Add this to your PATH environment variables:

C:Program Files (x86)Windows Kits8.0inx86

Copy these files:

rc.exe
rcdll.dll

From

C:Program Files (x86)Windows Kits8.0inx86

To

C:Program Files (x86)Microsoft Visual Studio 11.0VCin

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/

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. Installing the Microsoft .Net Framework 2.0
  2. Adding the path of the .NET Framework files (for me "C:WINDOWSMicrosoft.NETFrameworkv2.0.50727") to Global compiler settings > Programs > Additional Paths within Code::Blocks.

Now I can build and link resource files without errors.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...