首页 > 编程语言 >Qt程序运行报错

Qt程序运行报错

时间:2024-03-23 22:35:53浏览次数:34  
标签:opt LD Qt 程序运行 LIBRARY qtcreator PATH 报错 Qt5.12

报错内容

PC环境为Ubuntu20.04,Qt版本是Qt5.12.9AsensingViewer是编译好的程序

./AsensingViewer: error while loading shared libraries: libicudata.so.56: cannot open shared object file: No such file or directory

问题分析

查看程序依赖

ldd AsensingViewer

注意到有个库not found

libicudata.so.56 => not found

cmake配置

link_directories("/opt/Qt5.12.9/5.12.9/gcc_64/lib")

但问题依旧,于是乎设置环境变量,./AsensingViewer成功

export LD_LIBRAR_PATH="/opt/Qt5.12.9/5.12.9/gcc_64/lib"

问题解决,但怎么实现一劳永逸?在家目录.bashrc文件末尾加入一行代码

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"/opt/Qt5.12.9/5.12.9/gcc_64/lib"

注意事项

设置了.bashrc环境变量会导致qtcreator运行报错然后崩溃

(qtcreator:3781): GLib-CRITICAL **: 19:42:15.563: g_hash_table_contains: assertion 'hash_table != NULL' failed

(qtcreator:3781): GLib-CRITICAL **: 19:42:15.563: g_hash_table_insert_internal: assertion 'hash_table != NULL' failed
Segmentation fault (core dumped)

运行前记得刷新一下LD_LIBRARY_PATH,让qtcreator自己找依赖

export LD_LIBRARY_PATH=""
/opt/Qt5.12.9/Tools/QtCreator/bin/qtcreator

或者直接在.bashrc文件加入以下内容,然后两种变量设置就可以完美共存

alias qtcreator='export LD_LIBRARY_PATH="" && /opt/Qt5.12.9/Tools/QtCreator/bin/qtcreator'

标签:opt,LD,Qt,程序运行,LIBRARY,qtcreator,PATH,报错,Qt5.12
From: https://www.cnblogs.com/hywing/p/18091812

相关文章

  • Windows库链接报错
    问题回溯今天拿到别人已经编译好的库,发现在链接的时候出现了报错[9/912.7/sec]LinkingCXXsharedmodulebin\plugins\AsensingPlugin\AsensingPlugin.dllFAILED:bin/plugins/AsensingPlugin/AsensingPlugin.dllcmd.exe/C"cd.&&"C:\ProgramFiles\CMake\bin\cmake.e......
  • foxy rviz2 "rviz_common/Time"报错问题
    报错内容Theclassrequiredforthispanel,'rviz_common/Time',couldnotbeloaded.Error:Accordingtotheloadedplugindescriptionstheclassrviz_common/Timewithbaseclasstyperviz_common::Paneldoesnotexist.DeclaredtypesareTeleopPanel......
  • CentOS加载yum源时报错 [Errno 14] HTTP Error 404 - Not Found Trying other mirror.
    报错内容:[[email protected]]#yumrepolistLoadedplugins:fastestmirror,product-id,search-disabled-repos,subscription-managerThissystemisnotregisteredtoRedHatSubscriptionManagement.Youcanusesubscription-managertoregister.Determiningf......
  • MQTT概念篇
    MQTT(MessageQueuingTelemetryTransport)本篇文章是基于MQTT5.0版本编写,部分特性在3.1和3.1.1等版本中可能未启用。MQTT是一种轻量级、基于发布-订阅模式的消息传输协议,适用于资源受限的设备和低带宽、高延迟或不稳定的网络环境。它在物联网应用中广受欢迎,能够实现传......
  • 【踩坑随笔】Kaggle安装langchain相关依赖报错
    kaggle执行语句%pipinstalldatasetslangchainsentence_transformerstqdmchromadblangchain_wenxin安装langchain相关依赖报错的时候出现了以下报错主要是版本不匹配,报错什么就再加载什么就可以了,执行下面的语句%pipinstallkeras-core执行结果%pipinstallw......
  • [ROS 系列学习教程] rqt可视化工具箱 - 日志工具
    ROS系列学习教程(总目录)本文目录零、rqt可视化工具箱一、rqt_console二、rqt_logger_level零、rqt可视化工具箱rqt是ROS的一个软件框架,以插件的形式实现各种GUI工具。可以在rqt中将所有现有的GUI工具作为子窗口运行,也可以以独立方法运行,但rqt可以更轻松地同......
  • 前端报错 request to https://registry.npm.taobao.org/yorkie/download/yorkie-2.0.0
    前端npminstall报错:npmERR!requesttohttps://registry.npm.taobao.org/yorkie/download/yorkie-2.0.0.tgzfailed,reason:certificatehasexpired解决方式://1.清空缓存npmcacheclean--force//2.切换新源:npmconfigsetregistry镜像源npmconfig......
  • 初用scrapy 报错503 Service Unavailable问题
    毕设基于Hadoop的电子产品推荐系统 系统需要大量的电子产品信息,爬取的是中关村的数据(没有像京东一样的反爬机制)使用scrapyspider爬取页面信息中,可以获取部分页面数据,但爬取一些页面时,会报错503ServiceUnavailable部分代码详情defparse(self,response):if......
  • idea更新gitlab突然报错
    年前还用的好好的项目年后回来更新直接失败了,前后端都白搭,一样的报错:Updatefailed/opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_logger.rb:72:inwrite:Nospaceleftondevice@io_write-/var/log/gitlab/gitlab-shell/gitlab-shell.log(Errno::ENOSPC)f......
  • Qt打开已有工程方法
    在Qt中,对于一个已有工程如何进行打开?1、首先打开QtCreator2、点击文件->打开文件或项目,找到对应文件夹下的.pro文件并打开3、点击配置工程这样就打开对应的Qt项目了,点击运行即可看到对应的效果Qt开发涉及界面修饰,有PS基础设计起来更好一些,不过都可以慢慢学~......