Working on makefile project
Answered
Hi.
We are working on a makefile project(mostly linux based) that we compile on a compilation server using some scripts.
In the past, I managed to make it "work", so we at least can develop normally (on windows) [=normally: having all h files and all the references] using cygwin.
When I try it now again, I'm getting errors like "Unknown type name 'namespace'", that as far as I know can be explained if Clion thinks those are c files and not cpp.
The question is how can I fix it?
Please sign in to leave a comment.
Hello!
Since CLion 2018.2 you can open a project by loading its compilation database. A compilation database lets CLion detect project files and extract all the necessary compiler information, such as include paths and compilation flags. You cannot build (https://youtrack.jetbrains.com/issue/CPP-14271, should be added in CLion 2019.1 EAP) or run (https://youtrack.jetbrains.com/issue/CPP-14473) for now, but code insight does work for such projects. And a compilation database can be generated from make. More information about Compilation DB support in CLion can be found here: https://www.jetbrains.com/help/clion/compilation-database.html. And here is our detailed blog post about working with Makefiles in CLion using Compilation DB: https://blog.jetbrains.com/clion/2018/08/working-with-makefiles-in-clion-using-compilation-db/.
Maybe working via a compilation database will be more suitable in your case?