如何从 Linux 应用程序中排除/usr/include 路径? [英] How to Exclude /usr/include Path from Linux Application?

查看:53
本文介绍了如何从 Linux 应用程序中排除/usr/include 路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个无法避免的问题.Redhat 6(或大多数 linux 包)带有一个默认的 QT 包,在/usr/lib 和/usr/include 文件夹中安装了 headers/etc.

I am running into a problem I have not been able to avoid. Redhat 6 (or most linux packages) comes with a default QT package installed with headers/etc in the /usr/lib and /usr/include folders.

现在,我想在不删除旧版本的情况下链接到新版本的 QT.不幸的是,由于头文件在/include/文件夹中,gcc 会自动找到它们,然后使用错误的包含文件(而不是我在别处拥有的文件).

Now, I am wanting to link against a newer version of QT without removing the older version. Unfortunately, since the headers are in the /include/ folder, gcc automatically finds them, and then uses the wrong include files (instead of those which I have elsewhere).

我似乎无法阻止编译器自动执行此操作.我以前通过简单地手动删除旧的库/头文件来解决这个问题,但从长远来看,这是一个糟糕的解决方案.

I cannot seem to stop the compiler from automatically doing this. I have gotten around it previously by simply manually removing the old libraries/headers but this is a terrible solution long term.

我也不认为这个问题是 QT 特有的,它恰好是我当前的实例.

I do not think this problem is specific to QT either, it just happens to be my current instance of it.

有什么建议吗?

非常感谢:)

推荐答案

结果证明我的问题与使用的 qmake 版本不正确有关.它正在寻找以前版本的 qmake,即使它来自 qt4,它也链接到了错误的包含.

My issue turned out to be related to an incorrect version of qmake being used. It was finding a previous version of qmake, and even though it was from qt4, it was linking to the wrong includes.

更新 qmake 路径可以解决此问题.

Updating the qmake paths worked to fix this issue.

这篇关于如何从 Linux 应用程序中排除/usr/include 路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆