【问题标题】:XPIDL (typelib.py) type not found errorXPIDL (typelib.py) 类型未找到错误
【发布时间】:2013-04-07 19:27:16
【问题描述】:

我正在尝试构建一个使用 IDL 的 Firefox 扩展。但是,构建因此错误而终止:

[apply] Executing 'python' with arguments:
[apply] 'C:\Users\Dad\Documents\Sage\xulrunner-sdk/sdk/bin/typelib.py'
[apply] '-I'
[apply] 'C:\Users\Dad\Documents\Sage\xulrunner-sdk/idl/'
[apply] '-o'
[apply] 'C:\Users\Dad\Documents\Sage\build\xpi\components\sageIFeedParserListener.xpt'
[apply] 'C:\Users\Dad\Documents\Sage\src\components\sageIFeedParserListener.idl'
[apply]
[apply] Traceback (most recent call last):
[...]
[apply]   File "C:\Users\Dad\Documents\Sage\xulrunner-sdk\sdk\bin\xpidl.py", line 959, in resolve
[apply]     self.realtype = method.iface.idl.getName(self.type, self.location)
[apply]   File "C:\Users\Dad\Documents\Sage\xulrunner-sdk\sdk\bin\xpidl.py", line 271, in getName
[apply]     raise IDLError("type '%s' not found" % id, location)
[apply] xpidl.IDLError: error: type 'PRInt64' not found, sageIFeedItemEnclosure.idl line 44:32
[apply]   void init(in AString link, in PRInt64 length, in AString mimeType);

我正在使用最新版本的 xulrunner-sdk (20),我通过简单地解压到一个文件夹中来安装它;我不相信我需要做任何其他事情,但也许我错了?我有 Python 2.7.3。 typelib.py 调用中的路径似乎是正确的。 IDL 文件本身很简单,如下所示:

#include "nsISupports.idl"

[scriptable, uuid(73C6ECE6-0D9F-474C-8959-3979D2D1CBDB)]
interface sageIFeedItemEnclosure: nsISupports {

    void init(in AString link, in PRInt64 length, in AString mimeType);
}

我可以看到 PRInt64 是在 nsISupportsPrimitives.idl 中定义的。但是,即使我在尝试编译的 IDL 文件中专门包含该文件,我也会遇到同样的错误,所以我怀疑这是其他问题。

有什么想法吗?

【问题讨论】:

  • 如果将PRInt64 更改为int64_t 会发生什么?
  • int64_t 有效。那么这告诉我们什么?
  • 看我的回答,如果你不介意就接受吧:)

标签: firefox-addon xul xpcom xulrunner


【解决方案1】:

nsrootidl.idl 中定义了 64 位整数数据类型 int64_t,它包含在 nsiSupports.idl 中,因此随处可用。

您在nsISupportsPrimitives.idl 中看到的是nsISupportsPRInt64 接口的声明。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多