QT安装完加入VTK例子报错总结


layout: post # 使用的布局

title: QT安装完加入VTK例子报错 # 标题

subtitle: QT安装与VTK报错 #副标题

date: 2023-11-18 # 时间

author: BY ThreeStones1029 # 作者

header-img: img/about_bg.jpg #这篇文章标题背景图片

catalog: true # 是否归档

tags: VTK #标签


文章目录

一、前言

最近两天都在安装cmake、QT、VTK属于是碰到了一些坑,在此记录下来。

二、一些问题

2.1.QT安装问题

2.1.1.权限问题

QT在下载安装时一般需要chmod a+x给与.run文件权限,然后运行但是我在运行./qt-opensource-linux-x64-5.14.2.run安装时报错不能写入share文件夹。

解决方法:

在命令行前面加sudo

bash 复制代码
sudo ./qt-opensource-linux-x64-5.14.2.run

2.1.2.打开问题

在安装完后打开发现运行命令qtcreator报错

bash 复制代码
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Aborted (core dumped)

为了看具体报错,在环境里面加上一行

bash 复制代码
export QT_DEBUG_PLUGINS=1
bash 复制代码
# 让环境变量起作用
source ~/.bashrc

再次运行有报错如下

bash 复制代码
Got keys from plugin meta data ("xcb_glx")
QFactoryLoader::QFactoryLoader() checking directory path "/opt/QT5.14.2/Tools/QtCreator/bin/xcbglintegrations" ...
loaded library "/opt/QT5.14.2/Tools/QtCreator/lib/Qt/plugins/xcbglintegrations/libqxcb-glx-integration.so"
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Aborted (core dumped)

大概应该是加载这个libqxcb-glx-integration.so有问题,但是我不知道如何修改,只能采取到对应qtcreator所在路径下双击打开

2、VTK问题

2.2.1.权限问题

由于我的VTK在home下同时QT在opt路径下,用QT打开案例会发现有权限问题

解决方法:赋予整个VTK文件夹可读可写权限

bash 复制代码
sudo chmod -R 777 VTK-8.2.0

2.2.2.报错SimpleView: error while loading shared libraries: libQt5X11Extras.so.5: cannot open shared object file: No such file or directory

应该是没有这个库,运行命令

bash 复制代码
sudo apt install libqt5x11extras5

问题解决

相关推荐
Felix_One4 天前
Qt 串口通信避坑指南:QSerialPort 的 5 个常见问题
qt
blasit7 天前
笔记:Qt C++建立子线程做一个socket TCP常连接通信
c++·qt·tcp/ip
郑州光合科技余经理11 天前
代码展示:PHP搭建海外版外卖系统源码解析
java·开发语言·前端·后端·系统架构·uni-app·php
feifeigo12312 天前
matlab画图工具
开发语言·matlab
dustcell.12 天前
haproxy七层代理
java·开发语言·前端
norlan_jame12 天前
C-PHY与D-PHY差异
c语言·开发语言
多恩Stone12 天前
【C++入门扫盲1】C++ 与 Python:类型、编译器/解释器与 CPU 的关系
开发语言·c++·人工智能·python·算法·3d·aigc
QQ40220549612 天前
Python+django+vue3预制菜半成品配菜平台
开发语言·python·django
遥遥江上月12 天前
Node.js + Stagehand + Python 部署
开发语言·python·node.js
m0_5312371712 天前
C语言-数组练习进阶
c语言·开发语言·算法