来自 nmake:“没有规则可以生成目标‘*.rc’”
我正在尝试在 Windows 7 系统上从源代码构建 Putty Tray(Putty 的一种变体)。我需要构建它,而不仅仅是下载它,因为我需要实现一些附加功能。我正在使用 nmake 和(不应该相关)Microsoft C++ 编译器。准确地说,我正在 cmd 窗口中工作,位于 putty 源的 WINDOWS 文件夹中,并且正在运行命令 nmake -f MAKEFILE.VC。
C 源代码编译正确,但随后我遇到了一个我不理解的错误:
no rule to make target `*.rc' needed by `pageant.res'
我完全理解如果它说无法生成特定文件意味着什么:这意味着文件丢失。但我不明白这对于通配符有何意义。
MAKEFILE.VC 的大概相关部分是
pageant.res: *.c *.h *.rc ..\windows\pageant.rc ..\windows\rcstuff.h \ ..\windows\pageant.ico ..\windows\pageants.ico \ ..\windows\version.rc2 ..\windows\pageant.mft rc $(RCFL) -r $(RCFLAGS) ..\windows\pageant.rc
并且,是的,文件夹中有 *.rc 文件: PAGEANT.RC、PLINK.RC、PSCP.RC、PSFTP.RC、PUTTY.RC、PUTTYTEL.RC
有什么想法吗?
I am in the process of trying to build putty tray, a variant of putty, from source on a Windows 7 system. I need to build it, not just download it, because I need to implement some additional functionality. I'm using nmake and (shouldn't be relevant) the Microsoft C++ compiler. To be precise, I'm working in a cmd window, I'm in the WINDOWS folder of the putty sources, and I'm running the command nmake -f MAKEFILE.VC.
C sources are compiling correctly, but then I'm running into an error that I don't understand:
no rule to make target `*.rc' needed by `pageant.res'
I understand perfectly well what it would mean if it said it couldn't make a particular file: it would mean the file was missing. But I don't get how this makes sense with a wild card.
The presumably relevant part of MAKEFILE.VC is
pageant.res: *.c *.h *.rc ..\windows\pageant.rc ..\windows\rcstuff.h \ ..\windows\pageant.ico ..\windows\pageants.ico \ ..\windows\version.rc2 ..\windows\pageant.mft rc $(RCFL) -r $(RCFLAGS) ..\windows\pageant.rc
And, yes, there are *.rc files in the folder: PAGEANT.RC, PLINK.RC, PSCP.RC, PSFTP.RC, PUTTY.RC, PUTTYTEL.RC
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否考虑过尝试 gmake 而不是 nmake?
许多 makefile 驱动的开源项目发现 nmake 的局限性太大,并已将 Gnu 的 gmake 标准化为更好的工具。我还没有检查确定,但这有 nmake 限制的感觉,而 PuTTY 肯定是那种会使用 gmake 的项目。
GnuWin32 项目 是查找 gmake 的本机 Windows 版本的好地方。查看那里提供的其他软件包。它们是许多熟悉且有用的 Gnu 工具的本机 Windows 构建的良好来源。与 Cygwin 等项目相比,它们的优势在于它们的工具可以在正常的 CMD 提示符下工作,并且除了将其
bin
文件夹放在您的 PATH 中之外不需要安装,它们的 Windows 安装程序将负责处理该文件夹你。Have you considered trying gmake instead of nmake?
Much of the makefile-driven open source project world finds nmake too limiting and has standardized on the Gnu's gmake as a much better tool. I haven't checked to be sure, but this has the feel of an nmake limitation and PuTTY is certainly the sort of project that would use gmake.
A good place to find a native Windows build of gmake is at the GnuWin32 project. Check out the other packages available there. They are a good source of native Windows builds of a lot of the familiar and useful Gnu tools. They have an advantage over projects like Cygwin that their tools work at the normal CMD prompt, and don't require installation beyond having their
bin
folder in your PATH, which their nice Windows installer will take care of for you.