| Symbol 'std' could not be resolved and Symbol 'cout' could not be resolved. [message #1718888] |
Thu, 31 December 2015 17:13  |
Eclipse User |
|
|
|
I created a new project and everything was fine. I go into the project and I create a new Source File (yes I put the .ccp at the end).
I type in this code:
#include <iostream>
using namespace std;
int main()
{
cout << "This is a test.\n";
return 0;
}
There seem to be two red underlines, one under 'std' and one under 'cout'. I can't find the issue. I have already gone into the index and Searched for Unresolved Issues but nothing comes up and says 0 items when clearly something is wrong.
Can I get any help on this? It would be appreciated.
|
|
|
|
| Re: Symbol 'std' could not be resolved and Symbol 'cout' could not be resolved. [message #1726358 is a reply to message #1718971] |
Fri, 11 March 2016 14:14   |
Eclipse User |
|
|
|
===== UPDATE HEADING ======
Solution to the problem "Symbol 'cout' could not be resolved"
Unlike in Java or Python, etc., in C++ one does not select "File/New/C++ project", but "File/New/Project". And then from the newly open window, expand the "C/C++ option" and select "C++ Project".
Personally, I find this totally NOT normal, especially if one uses Eclipse for Python and Java.
Certainly, one has to follow the setup steps listed in Eclipse "C/C++ Development User Guide", "Before you begin" section. I accessed this from the Eclipse Workbench "C/C++ Development link.
===== UPDATE ======
There is only ONE "Create C++ Project" option. I have NO IDEA what you are talking about David Vavra. There are different options on the compiler to use. I used MinGW.
Anyway, I have the same problem, "Symbol 'cout' could not be resolved" when creating the Hello project. I did all the required things. See this link https://orfe.princeton.edu/help/article-296
Could anyone help, please? Is Eclipse good for anything at all in thise C++ field? I use it for Java, and I had no problems so far. I am running a separate Eclipse download specific for C++. find it totally ridiculous, that one cannot even run the Hello World project. I spent my entire evening on resolving this issue. I wanted to add a picture to this entry, but one can only add a picture with an URL. How smart is that?!
Thank you in advance for your assistance.
[Updated on: Fri, 11 March 2016 15:49] by Moderator
|
|
|
| Re: Symbol 'std' could not be resolved and Symbol 'cout' could not be resolved. [message #1726374 is a reply to message #1726358] |
Fri, 11 March 2016 18:23  |
Eclipse User |
|
|
|
Quote:here is only ONE "Create C++ Project" option. I have NO IDEA what you are talking about ... find it totally ridiculous, that one cannot even run the Hello World project.
I'm talking about the following dialog which appears when clicking on New Project ==> C/C++ ==> C++ Project. Looks like different options to me, I don't understand the source of your confusion, Hristian Temp. If you didn't access it then how did you create the Hello World project?

I would guess the steps outlined in your link are incomplete,
You have posted this twice. Once as a reply to another message and again as a new post but omitted some details. The image of your source page from the other post Indicates that the Indexer can't find <iostream>. Notice the big question mark beside it.
https://www.eclipse.org/forums/index.php?t=getfile&id=25270&
Generally, this is handled by the discovery options which can be accessed for Project ==> C/C++ General ==> Include. Paths, Macros, etc. under the Providers tab. You need to select the proper one for MinGW. Frankly, I don't know which one that would be. You would need to enable the proper provider to get the compiler default include search paths. The command for doing this can be found in the box below after selecting a provider line.
The other tab, Entries, shows the paths which have been provided.At the very least you can add the path to the libraries by hand under the User Setting Entries. That would seem tedious though.
You seem quite new to all of this. The necessary steps may vary and we can't see what you are seeing. Attempting to cover all possibilities is not really practical.
Perhaps someone with more experience in dealing with MinGW can help out.
EDIT:
for whatever reason the image didn't appear. I've uploaded a new one.
[Updated on: Fri, 11 March 2016 18:26] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.05971 seconds