External header files for Makefile Project ?

Answered

How do I specify additional include directories external to the project tree ?

 

For my Linux project edited using CLion on windows (mentioned in my previous post) CLion does not find the STL header files like for:

 

#include <string>

I find a lot of posts about how adding external include directories to CMakew projects but not Makefile.On the other hand I read that CMakeLists.txt is also read for Makefile projects, so I created the file and added a single lien "include_directories(D:/cygwin64/usr/include/c++/v1)" But this does not seem to find the string include.

P.S.: In my research I did also stumble over the fact that Makefile projects do not currently support remote toolchains, which is a pity as this is probably the main use under WIndows. So I switched back to the cygwin toolchein just to parse the Makefile. 

 

 

 

2 comments
Comment actions Permalink

I managed to get this sorted, at least partely, and as far as I do currently require it to work. There was a problem with my cygwin toolchain identifying a wrong c++ compiler. I did not thing I need the compiler in the first place as I was only intending to read the Makefile.project. 

 

After I pointed the toolchain to the GCC-C++ compiler the makefile project parsing went through. withoiut error. While it had errors before, there again I believed this to be no big issue as all project internal header files were successfully resolved.

 

With the new C++ toolchain now all STL headerfile are resolved and types correctly displayed, but all project internal header files are underlined read and marked "not found", for then telling its correct path in the same tooltip. Probablky one resulting from the make run and one from CLion resolution? Since CLion correctly identifies also the internal types that's ok for me. 

@IntelliBrains: the project processing of Makefile and CMake projects should really be documented, stating what CLion does for reading the project, which information it collects from where (from make, cmake, built-in,...), their order,  and which results are produced if errors occur at any of these stages., etc...

 

This would it make much easier for developers to understand, identify and fix problems like this one.

 

0
Comment actions Permalink

Hello!

C++ is the language which parsing/resolve requires some extra knowledge like compilation flags, header search paths, etc. This information is stored in the project model and has to be extracted from there. So smart and project-wide coding assistance is provided only if the project is loaded successfully. Please see https://www.jetbrains.com/help/clion/project-models.html. 

Basically "for reading the project" CLion just loads it. If project loading fails, code insight features don't work properly.

0

Please sign in to leave a comment.