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

问题解决

相关推荐
蜡台1 小时前
通过Gradle脚本声明更改Java变量
android·java·开发语言·python·kotlin·gradle·groovy
小喻同学i2 小时前
std::thread函数参数传递
开发语言·c++
Ulyanov3 小时前
Python实现6-DOF刚体仿真器(下)——环境扰动与控制闭环
开发语言·python·算法·系统仿真·雷达电子对抗·导引头
分布式存储与RustFS3 小时前
RustFS Beta.10 性能解读:PUT 全面反超 MinIO,Rust 重写对象存储成了?
开发语言·后端·rust
小小的木头人3 小时前
Python 批量解析 Excel 经纬度,调用高德地图 API 获取中文地址
开发语言·python·excel
nzz_1712144 小时前
PHP程序员转型AI岗位指南:核心技能、北京就业市场与转型路径分析
开发语言·人工智能·php
Risehuxyc4 小时前
C# 将doc转换为docx
开发语言·c#·xhtml
多加点辣也没关系5 小时前
JavaScript|第24章:事件循环与并发模型
开发语言·javascript·ecmascript
ん贤6 小时前
怎么设计,才算一个优秀审计模块
大数据·开发语言·设计·审计
l1t6 小时前
测试用rust重写的postgresql: pgrust
开发语言·postgresql·rust