简体   繁体   English

如何在不使用qmake的情况下使用QT创建者“在光标下跟随符号”功能

[英]How can I use QT creator “follow symbol under cursor” feature without using qmake

I have an existing C++ project that uses a standard makefile which I have imported into QT creator 4.1.0 on Ubuntu 16.04. 我有一个使用标准makefile的现有C ++项目,该文件已导入Ubuntu 16.04上的QT Creator 4.1.0。 It compiles and runs fine from the build menu in creator, but in the editor some of the #include s are underlined in yellow (with error "No such file or directory"), and the symbols from those headers consequently fail to resolve when I use the "follow symbol under cursor" feature. 它可以在创建器的生成菜单中编译并运行良好,但是在编辑器中,某些#include带有黄色下划线(错误为“ No such file or directory”),因此,当我将这些标头中的符号解析时,使用“在光标下跟随符号”功能。

Includes such as the following appear to work fine: 包括以下内容似乎可以正常工作:

#include <vector>
#include <sys/types.h>
#include "myInclude.h"

Whereas includes from custom libraries do not: 而自定义库中的包含则不:

#include <some_namespace/something.h>

If I change the above non-functional include to: 如果我将上述非功能性包含项更改为:

#include "../../../some_library_proj/include/some_namespace/something.h"

then it works. 然后就可以了。

There is a file myproject.includes that includes the path ../some_library_proj/include/some_namespace , but that doesn't appear to have any effect on the problem at hand. 有一个文件myproject.includes ,它包含路径../some_library_proj/include/some_namespace ,但似乎对当前问题没有任何影响。

I have searched for similar discussions online, and they usually mention editing a .pro file, however I believe this should not apply in my case since I'm not using qmake. 我在网上搜索了类似的讨论,他们通常提到编辑.pro文件,但是我认为这不适用于我的情况,因为我没有使用qmake。

What files or environment variables do I need to change to get my imports working? 为了使导入正常工作,我需要更改哪些文件或环境变量?

Include the lower-level folders in the myproject.includes file as well. 也将较低级别的文件夹包括在myproject.includes文件中。 In this case: 在这种情况下:

../some_library_proj/include/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM