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

问题解决

相关推荐
天堂的恶魔9463 分钟前
QT —— 信号和槽(槽函数)
开发语言·qt
水w9 分钟前
【Python爬虫】详细入门指南
开发语言·爬虫·python·scrapy·beautifulsoup
XXYBMOOO14 分钟前
基于 Qt 的 BMP 图像数据存取至 SQLite 数据库的实现
数据库·c++·qt
Susea&1 小时前
数据结构初阶:双向链表
c语言·开发语言·数据结构
pianmian11 小时前
arcgis几何与游标(1)
开发语言·python
-曾牛1 小时前
【LangChain4j快速入门】5分钟用Java玩转GPT-4o-mini,Spring Boot整合实战!| 附源码
java·开发语言·人工智能·spring boot·ai·chatgpt
nanzhuhe2 小时前
python中参数前**的含义
开发语言·python
wt_cs2 小时前
身份认证C#集成方案-数字时代身份证实名认证利器
开发语言·c#
ghost1432 小时前
Python自学第2天:条件语句,循环语句
开发语言·python·学习
Chandler242 小时前
Go:低级编程
开发语言·后端·golang