Incorrect C/C++ path processing
Observed on 2017.3 / Windows 10.
With the right include directories added to the project file
#include <ti/drv/i2c/I2C.h>
is not recognized but
#include </ti/drv/i2c/I2C.h>
is. The same is true about any similar preprocessor statement <> or ""
Please sign in to leave a comment.
@Ivkogan I've tried on 2017.3.1 / Windows 10. The include is recognised (since A, defined in new.h, is resolved correctly):
Could you please try CLion 2017.3.1? If the issue persists, please provide more details (maybe I missed smth in my testing?).
I tried 2017.3.2 with pretty much the same result. Details:
The file is at C:\ti\pdk_am335x_1_0_8\packages\ti\drv\pruss\src\pruicss_intc.c.
The project folder is C:\ti\pdk_am335x_1_0_8\packages
In the cmake file:
I may have some answers. The project was imported from existing sources. I had to mark the root directory as library sources to avoid the error message about a file not belonging to any project. SOME of the lower level directories in the file tree can be marked as project sources sources and headers, and that helps with the header paths. I must say this is pretty annoying. All I wanted to do was to point to a folder with my source files, and recursively add to a new project. Is there a work around?
@Ivkogan here is my testing:
My project folder is "C:\Users\Anna.Falevskaya\CLionProjects\untitled2" (main.cpp is located in this directory).
The new.h file is located in "C:\Users\Anna.Falevskaya\CLionProjects\untitled2\folder1\folder2".
My CMakeLists.txt is:
My testing results are:
Please emulate the same situation with a new "Hello, World!" project. Is the behaviour on your side the same as on my side?
Please also remove all "include_directories(ti)" from your CMakeLists.txt except "include_directories(ti)", reload the CMake project (Tools | CMake | Reset Cache and Reload Project) and try to include the headers as "#include "drv/pruss/pruicss.h". Does it work?
I don't think the hello, world exercise makes much sense as creating a new project is apparently different from importing from existing sources - and that's what I did. That's what I did:
https://www.jetbrains.com/help/clion/importing-existing-non-cmake-project.html
I tried the cmake file changes you suggested, and they did not work:
In any case here is the cmake file to illustrate code complexity:
@Ivkogan actually if all files are added via add_executable, you don't need include_directories.
Please send your original project to clion-support at jetbrains.com so that I could test the import on my side.