`
huozheleisi
  • 浏览: 1226980 次
文章分类
社区版块
存档分类
最新评论

fatal+error+RC1107:+invalid+usage;+use+RC+/?+for+Help

 
阅读更多

今天莫名其妙地遇到这个问题。新建的MFC Dialog 项目都无法使用资源视图,“fatal error RC1107: invalid usage; use RC /? for Help”

经过一番Google,暂时解决如下:
“工具”->"选项"->"项目和解决方案"->"VC++ 目录" : "包含文件" 里面的条目如果有绝对路径(比如我的"C:/Boost/include/boost-1_33_1"),把其中的反斜线(/)替换为双反斜线(//)或者替换为斜线(/ 这个是我实验出来的,我喜欢这样,兼容Linux风格)。

至于原因,大概是VC8传递给 rcdll.dll 的命令行参数有问题,是一个Bug。具体参看大牛的分析 。


http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/e4ef7904-0947-4792-aa4a-b28077146d02/

The bug happens in the IDE. The IDE passes the command line to rcdll.dll when calling the exported functions RC and RCW. Its passed as the 5th parameter. I'm not sure how much of the IDE code is running in .NET, but I couldn't get much call history from the stack. The command line may have originated in resedit.dll.

The command line that cause the problem is below. Note the quote after P: in the middle of the text.

PlatformSDK/bin/rcdll.dll./s./x./I.D:/Program Files/Microsoft Visual Studio 8/VC/include;D:/Program Files/Microsoft Visual Studio 8/VC/atlmfc/include;D:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/include;D:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/common/include;D:/Program Files/Microsoft Visual Studio 8/SDK/v2.0/include;E:/ArmourSoft/SourceSafe2004;P:" /r /FO E:/ArmourSoft/SourceSafe2005/Projects/SmartSafe_5.0/ArmourSoft/FileSafe/ASCipher/ASCipher.aps /L 0x809 E:/ArmourSoft/SourceSafe2005/Projects/SmartSafe_5.0/ArmourSoft/FileSafe/ASCipher/ASCipher.rc

- Andy

http://blog.csdn.net/cuglij/article/details/3725211

今天莫名其妙地遇到这个问题。新建的MFC Dialog 项目都无法使用资源视图,“fatal error RC1107: invalid usage; use RC /? for Help”

经过一番Google,暂时解决如下:
“工具”->"选项"->"项目和解决方案"->"VC++ 目录" : "包含文件" 里面的条目如果有绝对路径,去掉路径最后的 "\"

至于原因,大概是判断路径是否存在时用了 access 导致多个 \ ,判断路径不存在了。

很奇怪的是以前创建的工程还是可以的,只是新建工程不行,不知道是不是和最近装的2008有关

Google了一下,http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=123870&SiteID=1

原因是Tools->Options->VC++Directories->Include Files中有以/结尾的路径; rc.exe会把最后的/换成", 但开头没有对应的引号, 所以解析错误. 把路径最后的/去掉就好了.

VC默认的包含路径都不是以/结尾的, 所以该错误一般发生在自己添加的路径上(比如DirectX的头文件路径).



分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics