【Qt】启动QtCreator时报错:Cannot mix incompatible Qt library (version ) with this library (version...

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u010168781/article/details/89916179
1、问题描述

当启动QtCreator时报错(我的Qt版本是Qt5.6.3):

Cannot mix incompatible Qt library (version 0x50603) with this library (version 0x50601)
Aborted (core dumped)
2、原因分析

原因是QtCreator使用的Qt库版本是5.6.1,而环境中配置的Qt库版本是5.6.3
1)QtCreator使用的Qt库版本

~/qt/Qt5.6.3/Tools/QtCreator/lib/Qt/lib/$ ls
libicudata.so.56                   libQt5EglDeviceIntegration.so.5      libQt5Qml.so.5                 		
libQt5Svg.so.5
libicudata.so.56.1                 libQt5EglDeviceIntegration.so.5.6    libQt5Qml.so.5.6               	
libQt5Svg.so.5.6
libicui18n.so.56                   libQt5EglDeviceIntegration.so.5.6.1  libQt5Qml.so.5.6.1         
...    

2)环境中配置了Qt库路径

export LD_LIBRARY_PATH=~/qt/Qt5.6.3/5.6.3/gcc_64/lib

或者

PKG_CONFIG_PATH=~/qt/Qt5.6.3/5.6.3/gcc_64/lib/pkgconfig
3、解决方法

Qt官方已经对该问题,给出了解决方法,就是使用qtcreator同目录下的qtcreator.sh启动
qtcreator.sh中开头的注释如下,大致意思是:
如果向LD_LIBRARY_PATH添加包含与Qt Creator所依赖的库冲突的库的路径,请使用此脚本。

  #! /bin/sh
   
  # Use this script if you add paths to LD_LIBRARY_PATH
  # that contain libraries that conflict with the
  # libraries that Qt Creator depends on.

这个问题困扰了我很久,终于找到最终解决方案。

猜你喜欢

转载自blog.csdn.net/u010168781/article/details/89916179