-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to load even simple CMake project into Eclipse CDT #576
Comments
Try checking if Project -> Build Automatically is checked, and if so uncheck it to enable the build options.
CMake projects need the build information to resolve, so a first build is needed to collect the include locations from the |
It has no active build configurations (nor the ability to set one), and it's unchecked and is still grey. |
Here is the content of my compile_commands.json, I don't know how this will resolve the inclusions:
|
I'm not a cmake expert, so not sure where this is failing - sounds like the index isn't refreshing properly once the compile commands are ready. I'll leave it to others in the community to answer those aspects. We have been discussing how to improve cmake integration in #419 FWIW |
CDT parses the |
I just tested it with Eclipse 2023-09 on Windows 10. I've seen the same issue as @bkeys with the old C/C++ Editor. The include/ The easiest way to import a Cmake project into Eclipse CDT is to the import function: The user has to add a CompileFlags:
# When using clangd update this entry to point at the desired
# configuration directory to pick up the compile_commands.json
CompilationDatabase: build/default I assume that the reason for the problems in the old editor is maybe caused by CDT cannot find the |
That's not true. The |
I have same Problem with Kubuntu 22.04 and eclipse 2023-06 and 2024-06. If you include a system header like iostream, the inclusion couldn't be resolved. |
@razor5k which C/C++ editor are u using? The old or the new LSP based? |
It's the old one. The project compiles successfully. The CMakeLists.txt
The main.cpp
Additionally I checked C/C++ Editor (LSP) as well. The iostream couldn't be resolved either. |
If I create a CMake project by eclipse, it works but if I import an eclipse project created by CMake, the indexer don't work with system includes. Indexers are enabled. |
Does your imported project has a CMake Nature? (Project Properties->Project Natures) Which natures does it have at all? |
The Natures are (ordered) |
Can you please try to add the CMake Nature to the imported project and check if this helps? |
Unfortunately it doesn't change anything. I don't even know if that's an issue with cmake rather than with eclipse cdt. |
I think it's an CDT import problem. Maybe it makes sense to implement a CMake project import wizard. |
After adding the CMake Nature, following things are happened: |
Describe the bug
To Reproduce
Steps to reproduce the behavior:
Expected behavior
To have the build option not greyed out, and to be able to resolve inclusions like
#include <iostream>
, on my installation it cannot resolve the lineusing namespace std;
.Screenshots
Version Information (please complete the following information):
OS and OS Version/extra details: Linux ppc64le Fedora 38
Eclipse Version from Help ->
CDT Version from Help -> About -> Installation Details -> Features tab [e.g. 10.3.1, 11.2.0]
The text was updated successfully, but these errors were encountered: