linux qmake配置的一个小问题

博主在Linux环境中遇到qmake配置不正确的问题,通过检查qmake -query的输出发现环境路径设置不准确。为了解决这个问题,博主创建了软链接,并调整了/usr/share/qtchooser/qt5-x86_64-linux-gnu.conf文件,最终成功解决了配置问题。
摘要由CSDN通过智能技术生成

之前安装了qt和qmake,完了自己搞一直不行,步骤如下:

先搞了个qt标程:

#include <QApplication>
#include <QLabel>

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QLabel *label = new QLabel("Hello Qt!");
    label->show();
    return app.exec();
}

完了执行

qmake -project
qmake test.pro
make

结果一直报错:

a.cpp:1:24: fatal error: QApplication: No such file or directory
 #include <QApplication>
                        ^
compilation terminated.
make: *** [a.o] Error 1

就算在test.pro加上 QT += widgets也不行

后来运行qmake -query发现各个环境的路径都不大对,查看qmake路径:

/opt/Qt5.3.2/5.3/android_armv7/bin/qmake
/opt/Qt5.3.2/5.3/gcc_64/bin/qmake
/usr/bin/qmake
/usr/li
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值