Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Unresolved inclusion of 'iostream' in a new CMake Hello World project
Unresolved inclusion of 'iostream' in a new CMake Hello World project [message #1847474] Thu, 28 October 2021 11:57 Go to next message
Maciej S is currently offline Maciej SFriend
Messages: 2
Registered: October 2021
Junior Member
Hello,

I've recently switched from Eclipse 2020-03 to 2021-09 and I noticed that autocomplete feature doesn't work in either of my existing CMake projects, so I started looking for the problem with the simplest possible scenario:

I create a new Hello World CMake project within Eclipse. This compiles and runs well, but the autocomplete doesn't work already here! On the other hand, if I create the C++ Managed build then project building, running and autocomplete works (so it's not the problem with my OS or libraries). Interestingly, only the autocomplete is disabled - error highlighting works correctly.
Do you have any hints on how to fix autocomplete for CMake?

Additional background information:
- OS: Ubuntu 20.04.3, cmake version 3.16.3
- For my main projects, I generate my CMakeLists files manually, build them externally with `-G "Eclipse CDT4 - Unix Makefiles"` flag, and then import it in eclipse. This worked well in Eclipse version 2020-03, but not anymore due to autocomplete feature missing.
Re: Unresolved inclusion of 'iostream' in a new CMake Hello World project [message #1847479 is a reply to message #1847474] Thu, 28 October 2021 14:05 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
I don't normally use CMake but I ran some tests a while back.
It seems that CMake projects rely on the global builtins provider
and will run it on every build. The Indexer won't work until this
happens.

You might want to set the provider to allocate a console so you
can know when it runs.
Re: Unresolved inclusion of 'iostream' in a new CMake Hello World project [message #1847484 is a reply to message #1847479] Thu, 28 October 2021 15:31 Go to previous messageGo to next message
Maciej S is currently offline Maciej SFriend
Messages: 2
Registered: October 2021
Junior Member
But that's not really my case. Indexer works well. When I start rebuilding the index, I see all of the code getting underlined with red markings, but after it completes the red underlines disappear and a correct syntax highlighting is used.
The only missing thing is the autocomplete.

See the attached screenshot. There are no suggestions for my f variable of the fstream type and at the same time the syntax checker highlights the typo introduced intentionally in the second test function.
Re: Unresolved inclusion of 'iostream' in a new CMake Hello World project [message #1847486 is a reply to message #1847484] Thu, 28 October 2021 17:19 Go to previous message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
I guess what I find confusing is the title of your post begins:
Unresolved inclusion of 'iostream' ...
and I gave an answer to resolve it assuming it would fix the other problem.
But now you say you only meant the autocomplete issue.

I don't have an answer for that. It seems to work for me.
As for it underlining fostream you do realize that recognizing what has not
been defined is more or less independent of content assist, yes? That you can
have the former without the latter?

Have you checked that content assist has been enabled?






Previous Topic:What is a function of "Build targets"?
Next Topic:indexer not working on *.cpp files
Goto Forum:
  


Current Time: Wed Apr 24 23:15:10 GMT 2024

Powered by FUDForum. Page generated in 0.03431 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top