我正在尝试构建一个使用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文件中特别包含该文件,也会得到相同的错误,所以我怀疑这是其他问题。
有什么想法吗?
发布于 2013-04-08 17:38:49
64位整数数据类型int64_t是在nsrootidl.idl中定义的,它包含在nsiSupports.idl中,因此到处都可以使用。
您在nsISupportsPrimitives.idl中看到的是nsISupportsPRInt64接口的声明。
https://stackoverflow.com/questions/15866785
复制相似问题