我正在编写一个 XPCOM 组件。我有我的 idl 文件,它非常简单,只包含以下内容:
#include "nsISupports.idl"
[scriptable, uuid(4ead-ba5c-49c9-beb2=64209c7699a)]
interface nsIPageSummary : nsISupports
{
boolean saveSummary(in nsIDOMDocument document,
out unsigned long numLinks,
out unsigned long numImages);
};
我下载了 xulrunner sdk 并尝试通过以下命令从包含上述文件 (nsIPageSummary.idl) 的目录中生成我的标头:
~/xulrunner-sdk/sdk/bin/header.py --cachedir=~/xulrunner-sdk/idl/ -o nsIPageSummary.h nsIPageSummary.idl
当它运行时,我收到以下消息:
$ ~/xulrunner-sdk/sdk/bin/header.py --cachedir=~/xulrunner-sdk/idl -o nsIPageSummary.h nsIPageSummary.idl
Traceback (most recent call last):
File "~/xulrunner/xulrunner-sdk/sdk/bin/header.py", line 497, in <module>
idl.resolve(options.incdirs, p)
File "~/xulrunner/xulrunner-sdk/sdk/bin/xpidl.py", line 285, in resolve
p.resolve(self)
File "~/xulrunner-sdk/sdk/bin/xpidl.py", line 255, in resolve
raise IDLError("File '%s' not found" % self.filename, self.location)
xpidl.IDLError: error: File 'nsISupports.idl' not found, nsIPageSummary.idl line 1:0
#include "nsISupports.idl"
我已验证文件存在于上述文件夹中。我使用 MDN 链接(https://developer.mozilla.org/en-US/docs/XPIDL/pyxpidl)作为指南,但它没有多大帮助。我如何使用这些工具?