编译IDL生成RDB文件报错:无法解析XInterface基类,求解决方案
LibreOffice UNO IDL编译错误:无法解析XInterface基类
问题详情
你编写的IDL文件内容:
#include <com/sun/star/uno/XInterface.idl> module org { module libreoffice { module sheet { module formulas { interface XDataLinkFormulas : com::sun::star::uno::XInterface { long Vol( [in] long a, [in] long b, [in] long c ); }; }; }; }; };
在Linux系统中执行编译命令:
sudo ./unoidl-write formulas.idl formulas.rdb
收到报错:
Bad input file:///opt/libreoffice7.5/sdk/bin/formulas.idl: cannot parse line 4: "interface type org.libreoffice.sheet.formulas.XDataLinkFormulas direct base com.sun.star.uno.XInterface does not resolve to an existing interface type"
修复方案
指定UNO IDL的包含路径
unoidl-write无法自动定位LibreOffice标准UNO接口的IDL文件,需要通过-I参数指定SDK的IDL根目录。执行以下命令(路径根据你的SDK实际安装位置调整):./unoidl-write -I /opt/libreoffice7.5/sdk/idlc/idl formulas.idl formulas.rdb先确认
/opt/libreoffice7.5/sdk/idlc/idl/com/sun/star/uno/XInterface.idl文件存在,若路径不符,修改-I后的路径到正确的IDL目录。移除不必要的sudo
不要用sudo执行编译命令,否则可能导致生成的formulas.rdb文件权限异常。确保当前用户对工作目录有读写权限,直接执行上述修正后的命令即可。
内容的提问来源于stack exchange,提问作者Anton
相关产品推荐
相关产品推荐

