【问题标题】:Path conflict in Qt CreatorQt Creator 中的路径冲突
【发布时间】:2014-10-08 14:32:57
【问题描述】:

在 Qt Creator 上构建项目时,出现错误:

Failure to read QMAKESPEC conf file /usr/share/qt4/mkspecs/linux-g++/qmake.conf.
Error processing project file: /path/to/my/project/directory/project.pro
01:13:32: The process "/usr/bin/qmake-qt4" exited with code 3.
Error while building/deploying project converter (kit: Qt 4.8.4 in PATH (System))
When executing step 'qmake'

但是当我执行时

locate qmake.conf

在终端上,我发现文件位于

/usr/lib64/qt4/mkspecs/linux-g++/qmake.conf

如何配置 Qt Creator 以考虑正确的路径?

【问题讨论】:

    标签: qt4 qt-creator


    【解决方案1】:

    您可以尝试使用-spec 参数运行qmake

    $qmake -spec /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf *.pro
    

    或者您可以在旧文件的位置创建指向新文件的符号链接(这将成为永久解决方案)

    #ln -s /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mkspecs/linux-g++/qmake.conf
    

    或者你可以设置环境变量QMAKESPEC来对应新的值

    QMAKESPEC = /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf
    export QMAKESPEC
    

    要使其永久化,请将其添加到您的 .bashrc(或您正在使用的任何 shell)中

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-02-14
      • 1970-01-01
      • 2021-03-09
      • 1970-01-01
      • 1970-01-01
      • 2014-01-02
      • 2021-11-18
      相关资源
      最近更新 更多