Home  >  Q&A  >  body text

linux - qmake 错误:could not find a Qt installation of ''

在进行 qmake 的时候,出现了下面的错误:

could not find a Qt installation of ''

我的操作系统是 LinuxQt 版本是 5.4 ,在 Qt 官网下载的最新版。使用 which qmake 也能够找到 qmake 的路径:

/usr/bin/qmake

然后 ls -al /usr/bin/qmake 的输出是:

/usr/bin/qmake -> qtchooser

不知道问题出在哪里,希望大家帮帮我!

先谢谢大家了!顺便给大家拜个年!


谢谢大家,问题已经解决!具体步骤:

因为我是将 Qt 安装在 /home 目录下,而且之前安装过旧版本的 Qt ,所以 qmake 软链接发生错误,只要使用重新建立正确的链接即可:

  1. 删除原先的链接: sudo rm /usr/bin/qmake
  2. 建立新的链接: sudo ln -s 你的Qt qmake 的位置 /usr/bin/qmake 即可,例如,我的 Qt qmake 的位置在 /home/Qt5.4.0/5.4/gcc_64/bin/qmake

这样就可以了!

天蓬老师天蓬老师2745 days ago1484

reply all(1)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-17 13:06:56

    qmake should be a link pointing to a specific qmake, for example, Qt4 may be qmake-qt4, on my Mac it is

    localhost:~ mac$ ls -al /usr/bin/qmake
    lrwxr-xr-x  1 macports  wheel  9 Nov 14 14:26 /usr/bin/qmake -> qmake-4.8
    

    Try to see if it points to your installation package normally

    reply
    0
  • Cancelreply