Indexer Problems when using eclipse CDT with Cmake [message #1792301] |
Sun, 15 July 2018 13:13  |
Eclipse User |
|
|
|
down vote
favorite
I have problems with the Index responsible for autocomplete and live code correction in eclipse CDT. When I setup an Eclipse project using the in eclipse CMAKE tools (New Project=>CMake Project) the indexer simply doesn't work and can't find any files outside the source directory (It can't find library headers, even the ones on /usr/).
It does sometimes kinda work if the inlcude_directory is set directly without usage of a variable, but its pretty random:
# this sometimes works
include_directories("/home/user/lib/test")
# this never does
set(PATH /home/marvin/Documents/trash)
include_directories(${PATH})
so is there a way to configure eclipses Index manually? So I can just add resource paths or something for the Indexer directly, so I can have code completion?
|
|
|
|
|
|
|
|
Re: Indexer Problems when using eclipse CDT with Cmake [message #1797861 is a reply to message #1792615] |
Wed, 07 November 2018 09:36   |
Eclipse User |
|
|
|
I have similar problems with the indexer...it just can't find any of the system includes, e.g. <stdio.h>, <stdint.h>, etc. I never used to have any of these problems prior to the Luna version, then things started to go "sideways". I still am holding out that the problem is a cockpit error on my part.
I am using Eclipse CDT Oxygen on Ubuntu18.04, and generating my Eclipse project using "cmake -G"Eclipse CDT4 - Unix Makefiles" (version 3.10.2 of cmake), then in Eclipse "Import->General->Existing Projects into Workspace". (Also tried importing as a Makefile project - indexer actually ran, but still didn't find the system includes, and had other problems like losing all the build targets, etc.) The "C/C++ Include Paths and Symbols" list the proper system folders that contain the system includes. I even added the following to my top-level CMakeLists.txt file based on a forum post:
########################################################################
# Eclipse IDE (Oxygen) specific setup
########################################################################
set (CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT TRUE CACHE BOOL "For cmake CDT4 generator." FORCE)
set (CMAKE_C_COMPILER_ID "GNU")
set (CMAKE_CXX_COMPILER_ID "GNU")
set (CMAKE_C_PLATFORM_ID "Linux")
set (CMAKE_CXX_PLATFORM_ID "Linux")
...but to no avail. When doing "Import as existing project" (since the cmake generator made the project files), the Indexer doesn't even run when doing a "Rebuild".
I've looked through many, many forum posts (Eclipse, stackoverflow, others), but often they mention pulldown menus that don't even show up in my Eclipse Oxygen IDE (probably due to "Import as existing" vs "Import as Makefile". I imagine this has something to do with Discovery Providers, but have been unable to figure it out.
|
|
|
|
|
|
Re: Indexer Problems when using eclipse CDT with Cmake [message #1854903 is a reply to message #1854164] |
Fri, 16 September 2022 20:41  |
Eclipse User |
|
|
|
Peter Borisenko wrote on Thu, 04 August 2022 06:22cmake4eclipse seems to be abandoned since 2021.
The cmake embedded in eclipse still works unwell.
My solution is to open cmake project as makefile project with existing code and create a bunch of build targets. It's is stupid solution. But it works.
cmake4eclipse, https://github.com/15knots/cmake4eclipse, seems active to me, last modification is 10 hours ago.
Btw, I am also having indexer issues but I am using the aforementioned plugin.
|
|
|
Powered by
FUDForum. Page generated in 0.05337 seconds