目录
fatal error: QTextCodec: No such file or directory
感谢博主:
c++程序从QT5(MSVC2015)移植到QT6.2(MSVC2019)_qtextcodec: no such file or directory-CSDN博客
问题描述1:
1. error: C1083: 无法打开包括文件: “QTextCodec”: No such file or directory
原因分析:
QT6版本已经去除了QTextcodec,需要使用QT5模块来兼容。
解决方案:
步骤1 首先在安装QT6时选择QT5兼容模块;
我安装的是QT6.2.2,目前已更新到6.3.0-beta,更新时选择自己已安装的版本的QT5兼容模块即可。
步骤2 配置文件 添加core5compat
然后在.pro文件中加入
greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat
原文链接:https://blog.csdn.net/qq_27450255/article/details/122893439