error: QTextCodec: No such file or directory
运行qt项目报错

error: QTextCodec: No such file or directory
运行qt项目报错

你用的Qt6吗?Qt6没有QTextCodec的,需要添加Qt5兼容模块
如果你是用的旧项目代码那还是直接安装Qt5比较好
包括你下面那个报错的qrand也是只有Qt5才有,Qt6没有的,装兼容模块也没用,需要按照新的API改代码
要在Qt Maintenance Tools里看到Qt5的话在添加组件界面右边Archive前打勾再按筛选,就能看到Qt5.15.x了