0

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. It compiles and runs fine from the build menu in creator, but in the editor some of the #includes 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.

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.

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.

What files or environment variables do I need to change to get my imports working?

Tim Rae
  • 3,167
  • 2
  • 28
  • 35
  • 1
    Not quite an answer to your situation, but in "Tools" => "Options" there is a C++ section. The tab "Code Model" allows you to specify additional options such as additional include paths. However AFAIK these are system-wide settings. – Elijan9 Sep 06 '16 at 10:33

1 Answers1

0

Include the lower-level folders in the myproject.includes file as well. In this case:

../some_library_proj/include/

Tim Rae
  • 3,167
  • 2
  • 28
  • 35
  • Rather than using a completely relative path, you may want to look at [How to get current relative directory of your Makefile?](https://stackoverflow.com/questions/18136918/how-to-get-current-relative-directory-of-your-makefile) E.g. `$(mkfile_path)../some_library_proj/include/ – Elijan9 Sep 06 '16 at 10:39