更新时间:2023-09-26 10:43:52
所使用的Qt安装将由您运行的qmake
决定.如果您安装了多个版本的Qt(例如,一个是您自己从源代码构建的版本,另一个是系统或Qt Creator安装提供的版本),则需要确保您正在使用要使用的Qt运行qmake
.您应该能够从命令行相当容易地验证这一点.如果您正在使用像Qt Creator之类的IDE并在选择正确的Qt时遇到问题,请首先尝试从命令行进行构建,以验证您可以通过这种方式获得正确的Qt作为第一步.如果从命令行完全控制使用哪个qmake
的操作仍然无法正常工作,则这表明您尝试使用的qmake
行为不符合预期.
The Qt installation that gets used will be determined by which qmake
you run. If you have multiple versions of Qt installed (e.g. one you built from sources yourself and one provided by the system or by a Qt Creator install), you need to ensure you are running the qmake
from the Qt you want to use. You should be able to verify this from the command line fairly easily. If you are using an IDE like Qt Creator and are having issues getting the right Qt selected, try building from a command line first to verify that you can get the right Qt that way as a first step. If building things from the command line where you have absolute control over which qmake
is used still doesn't work, then this would suggest the qmake
you are trying to use isn't behaving in the expected way.