linux - qmake 在 linux 上使用不正确的 Qt 安装路径

标签 linux qt qmake

我编译 qt (qt-everywhere-opensource-src-4.7.4) 使用:

./configure --prefix=/edrive/local/qt
gmake && gmake install

当我想用 qmake 创建新项目时,创建包含路径错误的 Makefile 并指向错误的二进制文件和库目录:

> qmake -query "QT_INSTALL_PREFIX"
/edrive/local

在生成文件中

包括:

-I/edrive/local/include/QtCore
-I/edrive/local/include/QtGui
-I/edrive/local/include

库:

-L/edrive/local/lib

用户界面:

/edrive/local/bin/uic

这些显然是错误的,因为 qt 安装在 /edrive/local/qt 中。

除了手动修改 qt 配置文件,有没有办法解决这个问题? 我做错了什么吗?

顺便说一句,它正在选择正确的 qmake:

> which qmake
/edrive/local/bin/qt/qmake

最佳答案

您可以通过以下方式更改该值:

# qmake -set VARIABLE VALUE

即在你的情况下:

# qmake -set QT_INSTALL_PREFIX /edrive/local/qt

虽然从你的qmake位置来看,你调用了错误的qmake。 尝试

/edrive/local/qt/bin/qmake -query "QT_INSTALL_PREFIX"

我感觉您还安装了 2 个 Qt。

关于linux - qmake 在 linux 上使用不正确的 Qt 安装路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8321664/

相关文章:

c++ - 在 Mingw 64 位上使用 Clang

更改目录时间/日期

linux - 从父文件夹和所有子文件夹中删除特定的命名目录

c++ - QT:未生成 ui_* 文件

c++ - QT 是在单独的线程中启动的slot

python - 集成 Jython Cpython

c++ - 运行 QWT 示例程序(.pro)并出现 Visual Studio 2010 错误

linux - 用指定的一个替换许多 PNG 文件

Json 提取键的字段名称列表

c++ - 在 Linux for Windows 上交叉编译 Qt5