Dev C%2b%2b Cout Does Not Name A Type

Home » Language IDEs » C / C++ IDE (CDT) » C%2b%2bDoesSymbol 'cout' could not be resolved

In the Problems View you can distinguish between compiler and code analyzer errors via the column problem type. In the editor there are different icons. But back to your problem. In your case it is a false warning. The code analyzer (CODAN) does not recognize the symbol 'cout' because it does not find the system includes (iostream). Where n is the character escape sequence for the newline character. The semicolon (;) notifies the compiler that a statement has ended.All C statements and class definitions require an ending/terminating semicolon. # Comments A comment is a way to put arbitrary text inside source code without having the C compiler interpret it with any functional meaning.

Show:Today's Messages::Show Polls::Message Navigator
  • Hi lonelycloud, I have been having some problems with the XXXX does not name a type and I'm interested to see how did you fix yours. Im sorry I cant help you with your other problem.
  • (Or however you do it through your favorite IDE) (Note: I just went with.cpp out of habit,.cc is also a valid extension, the compiler doesn't care) Study this code and see how it all connects.
  • In file included from c: mingw lib gcc mingw32 5.3.0 include c bits postypes.h:40:0.
Symbol 'cout' could not be resolved[message #1080966]Tue, 06 August 2013 16:12
Eclipse User
Hello,
I'm starting with Eclipse, but I cannot seem to be able to compile a
simple C++ Hello World program. On build, I have 2 errors:
Symbol 'cout' could not be resolved
Symbol 'endl' could not be resolved
I'm running:
* IDE: Eclipse-CDT, Version: Kepler Release, Build id: 20130614-0229 32-
bits
* JAVA: JRE 32-bits 1.7.0_25-b17
* Toolchain: MinGw: mingw-get-inst-20120426.exe with compilers for C, C+
+, and MSYS Basic System
* OS: Windows 7 Professional 64-bits
The program:
START
#include <iostream>
using namespace std;
int main() {
std::cout << '!!!Hello World!!!' << std::endl; // prints !!!Hello
World!!!
return 0;
}
END
I'm using toolchain MinGW GCC, with CDT Internal Builder. Environment
variables are:
MINGW_HOME = C:MinGW
MSYS_HOME = C:MinGWmsys1.0
PATH = ${MINGW_HOME}bin;${MSYS_HOME}bin;C:/Program Files (x86)/Java/jre7/
bin/client;C:/Program Files (x86)/Java/jre7/bin;C:/Program Files (x86)/
Java/jre7/lib/i386;;C:Program Files (x86)GTK2-Runtimebin;C:eclipse;
(etc)
Om C/C++ Build > Settings > Tool Settings > GCC C++ Compiler > Includes I
have added C:MinGWlibgccmingw324.6.2includec++
Everything else is set to defaults.
When I save and build the project, I get
09:32:32 **** Incremental Build of configuration Debug for project
Eclipse-002 ****
Info: Internal Builder is used for build
g++ -O0 -g3 -Wall -c -fmessage-length=0 -o 'srcEclipse-002.o' '..src
Eclipse-002.cpp'
09:32:32 Build Finished (took 90ms)
Unresolved Inclusions shows <iostream>, even though it's located at C:
MinGWlibgccmingw324.6.2includec++ and it's part of the GCC C++
includes.
I've been googling for a couple of days with no luck. I've removed
Eclipse, installed it from scratch. I had Cygwin installed besides MinGw
and I removed it. I've tried with 'std::cout' and without 'std::' .
I'm sure I'm overlooking something simple :/
Thank you in advance.
--
Sinner
Re: Symbol 'cout' could not be resolved[message #1081502 is a reply to message #1080966]Wed, 07 August 2013 09:53
Axel Mueller
Messages: 1973
Registered: July 2009
That is *not* a compiler error. It is an error from the static code analyzer. In the Problems View you can distinguish between compiler and code analyzer errors via the column problem type. In the editor there are different icons.
But back to your problem. In your case it is a false warning. The code analyzer (CODAN) does not recognize the symbol 'cout' because it does not find the system includes (iostream). Eclipse usually automatically finds the correct system includes (so need for you to add them in C/C++ Build > Settings > Tool Settings > GCC C++ Compiler > Includes ). However, to find these includes Eclipse needs to know where MinGW is installed. You correctly configured environment variables for MinGW. But there is a bug with respect to the scanner discovery in Eclipse (the part that looks for the system includes etc.). It seems to ignore your PATH settings. I would suggest that you modify the PATH variable in Windows directly and then start Eclipse. Then you should rebuild the index (Project->Index->rebuild).

Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Symbol 'cout' could not be resolved[message #1081813 is a reply to message #1081502]Wed, 07 August 2013 18:25
Eclipse User
On Wed, 07 Aug 2013 11:53:18 +0200, Axel Mueller wrote:
> That is *not* a compiler error. It is an error from the static code
> analyzer. In the Problems View you can distinguish between compiler and
> code analyzer errors via the column problem type. In the editor there
> are different icons.
> But back to your problem. In your case it is a false warning. The code
> analyzer (CODAN) does not recognize the symbol 'cout' because it does
> not find the system includes (iostream). Eclipse usually automatically
> finds the correct system includes (so need for you to add them in C/C++
> Build > Settings > Tool Settings > GCC C++ Compiler > Includes ).
> However, to find these includes Eclipse needs to know where MinGW is
> installed. You correctly configured environment variables for MinGW. But
> there is a bug with respect to the scanner discovery in Eclipse (the
> part that looks for the system includes etc.). It seems to ignore your
> PATH settings. I would suggest that you modify the PATH variable in
> Windows directly and then start Eclipse. Then you should rebuild the
> index (Project->Index->rebuild).
Axel,
Thank you for your message.
You were correct: not a compiler problem, it was a PATH problem with MinGW.
In the end I had to remove MinGW and install it from scratch, as the very
slow pipe to the Internet messed up the installation several times.
Now, with a complete (so far!) install of MinGW I can compile and run
projects from Eclipse.
Thank you again.
--
Salut,
Sinner
Previous Topic:Syntax Highlighting Oddities
Next Topic:linking with depending libraries
Goto Forum:
[ Syndicate this forum (XML) ] [ ]

Dev c%2b%2b cout does not name a type
Powered by FUDForum. Page generated in 0.02594 seconds

Hello. I am having difficulty trying to use the ByteBuffer lib. http://siggiorn.com/arduino-circular-byte-buffer/. I am sure it is something simple, and am hoping you can give me a hint…

I downloaded the .zip file, opened it and copied all the contained files into a subdirectoy named “ArduinoByteBuffer” in the …MyDocumentsArduinolibraries directory. (WinXP, Arduino 1.0.3)

I then try to compile the example sketch, but get the following error: “ByteBufferExample:8: error: ‘ByteBuffer’ does not name a type”

Does

Dev C%2b%2b Cout Does Not Name A Type

Here is the sample code (included with the Lib):

Dev C 2b 2b Cout Does Not Name A Type 1

Dev c 2b 2b cout does not name a type 2

And here is the entire list of error messages I get:

ByteBufferExample:8: error: ‘ByteBuffer’ does not name a type
ByteBufferExample.pde: In function ‘void setup()’:
ByteBufferExample:13: error: ‘buffer’ was not declared in this scope
ByteBufferExample.pde: In function ‘void loop()’:
ByteBufferExample:25: error: ‘buffer’ was not declared in this scope
ByteBufferExample:35: error: ‘buffer’ was not declared in this scope

I tried changing #include <ByteBuffer.h> to #include “ByteBuffer.h”, that did not help. I also tried moving the ByteBuffer lib into the c:programarduino… directory, again did not help.

Dev C 2b 2b Cout Does Not Name A Type 3

I am sure this is something simple, and would appreciate any pointers.