Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Indigo Service Release 2 -- where is the definition of "bool"?
Indigo Service Release 2 -- where is the definition of "bool"? [message #814151] Tue, 06 March 2012 04:58 Go to next message
JIA Pei is currently offline JIA PeiFriend
Messages: 49
Registered: September 2009
Member


Hi, all:

Environment:
OS: Ubuntu 11.10
Eclipse Indigo Service Release 2

I defined a "bool" variable in a struct in a .h header file. When I tried to build my project, I got the following error message:

Quote:
Multiple markers at this line
- unknown type name 'bool'
- Type 'bool' could not be resolved


After I do
#include "stdbool.h"
,
everything is now able to be compiled. However, why do I need to add "stdbool.h"? If under Windows, what's going on there?

Can anybody help to detailedly explain why " 'bool' could not be resolved." ?


Best Regards
Pei




Re: Indigo Service Release 2 -- where is the definition of "bool"? [message #814265 is a reply to message #814151] Tue, 06 March 2012 08:34 Go to previous message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Sounds like you are using bool in C code. The type bool is part of C++. However, it was introduced in C99 for C code. But then you need to include the stdbool.h header.

Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Previous Topic:Decrease the scope of autocompletion of content assist
Next Topic:eclipse build error
Goto Forum:
  


Current Time: Fri Apr 26 02:22:10 GMT 2024

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

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

Back to the top