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

问题解决

相关推荐
Y1rong5 小时前
C++ QT之记事本
开发语言·qt
diegoXie9 小时前
Python / R 向量顺序分割与跨步分割
开发语言·python·r语言
程序员小白条9 小时前
0经验如何找实习?
java·开发语言·数据结构·数据库·链表
liulilittle9 小时前
C++ 浮点数封装。
linux·服务器·开发语言·前端·网络·数据库·c++
IOT-Power9 小时前
QT 串口 源码结构框架
qt
失散139 小时前
Python——1 概述
开发语言·python
萧鼎9 小时前
Python 图像哈希库 imagehash——从原理到实践
开发语言·python·哈希算法
小小8程序员10 小时前
STL 库(C++ Standard Template Library)全面介绍
java·开发语言·c++
立志成为大牛的小牛10 小时前
数据结构——五十六、排序的基本概念(王道408)
开发语言·数据结构·程序人生·算法
老王熬夜敲代码10 小时前
C++中的atomic
开发语言·c++·笔记·面试