阅读:5606回复:20

qt插件加载的一个问题

楼主#
更多 发布于:2022-02-23 13:59
周大好:



KDE 版本是 Plasma5,qt 版本是 5.15.2 ,在 debian11 下,一切正常。



但在 manjaro ( Linux 5.13.19-2)  下面,qt 插件无法加载, cat 了一下 maps ,结果如下:





cmd.txt


其间,作了如下尝试: manjaro 输入法插件路径与其它发行版不同,是这个 ↓



/usr/lib/foxitreader/platforminputcontexts/libyongplatforminputcontextplugin.so


但无果,于是,就给小小的默认路径里,指了一个软链接:


ln -s /usr/lib/foxitreader/platforminputcontexts/libyongplatforminputcontextplugin.so /usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libyongplatforminputcontextplugin.so

依然不行……


周大看看,是不是还有其它的依赖没有加载上来。
沙发#
发布于:2022-02-23 14:13
你这个map.txt是输入法程序的map,它本来就正常吧。
manjaro 是操作系统吧?你这个路径怎么会是 /usr/lib/foxitreader/,这个不是foxit阅读器的路径吗?
插件加载不上更大可能是qt版本问题,你自己看一下qt版本是多少,必要时重新编译一个用
板凳#
发布于:2022-02-23 18:52
dgod:你这个map.txt是输入法程序的map,它本来就正常吧。
manjaro 是操作系统吧?你这个路径怎么会是 /usr/lib/foxitreader/,这个不是foxit阅读器的路径吗?
插件加载不上更大可能是qt版本问题,你自己看一下q...
回到原帖
路径乌龙了,但是插件确实没有加载过来,按道理,虽然我上面的操作有点画蛇添足,但可被软链寻址时,应该也是 work 的,qt版本是 5.12,恰好小小的网盘里有,版本理应是对得上的。
地板#
发布于:2022-02-23 20:52
cqoips:路径乌龙了,但是插件确实没有加载过来,按道理,虽然我上面的操作有点画蛇添足,但可被软链寻址时,应该也是 work 的,qt版本是 5.12,恰好小小的网盘里有,版本理应是对得上的。回到原帖
qt版本小版本也必须大于等于插件的版本。实在不行,还是得重新编译。
4楼#
发布于:2022-02-26 11:35
dgod:qt版本小版本也必须大于等于插件的版本。实在不行,还是得重新编译。回到原帖
找到了原因:

Debian 系下,之所以 KDE 可用,而同版本的 KDE 在 Arch 上用不了,是因为「qtbase5-dev」这个包,该包,在 Arch 上,名为「


qt5-base」




https://archlinux.org/packages/extra/x86_64/qt5-base/


观察 「Package Contents」可见,它是没有「Qt5.pc」文件的。


而「Qt5.pc」文件,是「Qt5」的目录分布:


# Qt5.pccat >%{buildroot}%{_libdir}/pkgconfig/Qt5.pc<<EOFprefix=%{_qt5_prefix}archdatadir=%{_qt5_archdatadir}bindir=%{_qt5_bindir}datadir=%{_qt5_datadir}docdir=%{_qt5_docdir}examplesdir=%{_qt5_examplesdir}headerdir=%{_qt5_headerdir}importdir=%{_qt5_importdir}libdir=%{_qt5_libdir}libexecdir=%{_qt5_libexecdir}moc=%{_qt5_bindir}/mocplugindir=%{_qt5_plugindir}qmake=%{_qt5_bindir}/qmakesettingsdir=%{_qt5_settingsdir}sysconfdir=%{_qt5_sysconfdir}translationdir=%{_qt5_translationdir}Name: Qt5Description: Qt5 Configuration
Version: 5.15.2
EOF
 


所以,不管是 Qt 插件的使用,还是 Qt插件的编译,都是在 Arch 下不可能完成的:




~/yong-master node build.js -C im/qt5-im                                                                                                                                                                            
Package Qt5 was not found in the pkg-config search path.
Perhaps you should add the directory containing `Qt5.pc'
to the PKG_CONFIG_PATH environment variable
Package 'Qt5', required by 'virtual:world', not found
node:child_process:903
    throw err;
    ^
 
Error: Command failed: pkg-config --modversion Qt5
Package Qt5 was not found in the pkg-config search path.
Perhaps you should add the directory containing `Qt5.pc'
to the PKG_CONFIG_PATH environment variable
Package 'Qt5', required by 'virtual:world', not found
 
   at checkExecSyncError (node:child_process:826:11)
   at Object.execSync (node:child_process:900:15)
    at shell (/home/i7/yong-master/build.js:589:23)
    at run (eval at _build_step (/home/i7/yong-master/build.js:528:8), <anonymous>:28:13)
    at eval (eval at _build_step (/home/i7/yong-master/build.js:528:8), <anonymous>:69:2)
    at _build_step (/home/i7/yong-master/build.js:528:8)
   at processTicksAndRejections (node:internal/process/task_queues:78:11) {
  status: 1,
  signal: null,
  output: [
    null,
    '',
    'Package Qt5 was not found in the pkg-config search path.\n' +
      "Perhaps you should add the directory containing `Qt5.pc'\n" +
      'to the PKG_CONFIG_PATH environment variable\n' +
      "Package 'Qt5', required by 'virtual:world', not found\n"
  ],
  pid: 1281,
  stdout: '',
  stderr: 'Package Qt5 was not found in the pkg-config search path.\n' +
    "Perhaps you should add the directory containing `Qt5.pc'\n" +
    'to the PKG_CONFIG_PATH environment variable\n' +
    "Package 'Qt5', required by 'virtual:world', not found\n"
}
 
Node.js v17.3.0
 
5楼#
发布于:2022-02-26 11:36
dgod:qt版本小版本也必须大于等于插件的版本。实在不行,还是得重新编译。回到原帖
需要周大调整一下 小小源码 的依赖关系
6楼#
发布于:2022-02-26 13:42
qtbase5-dev是开发包,arch上肯定也有对应的,你装一下就可以了
7楼#
发布于:2022-02-26 14:48
dgod:qtbase5-dev是开发包,arch上肯定也有对应的,你装一下就可以了回到原帖
Arch 上包名是 qt5-base 或 qt5-tools ,但都没有 Qt5.pc 这个文件,无法编译
8楼#
发布于:2022-02-26 14:50
dgod:qtbase5-dev是开发包,arch上肯定也有对应的,你装一下就可以了回到原帖
qtcreator qt5-base qt5-declarative qt5-serialport qt5-svg qt5-webkit 能找到的,全装了,都不行
Scfy
新手上路
新手上路
9楼#
发布于:2022-02-26 15:10
cqoips:qtcreator qt5-base qt5-declarative qt5-serialport qt5-svg qt5-webkit 能找到的,全装了,都不行回到原帖
Qt5.pc这个文件在arch系下名叫Qt5Core.pc,你把这个文件链接一下改个名就行了。
ln -sf  /usr/lib/pkgconfig/Qt5Core.pc /lib/pkgconfig/Qt5.pc,然后在编译就可以了
上一页
游客

返回顶部