This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: can't find <bool.h>


On 23 Mar 98 at 10:55,  Brendan Simon <BSimon@securenet.com.au> wrote:

> I am porting a V (C++ GUI) from Linux to Win32 using MinGW32.  I have
> done this before with the same program and it worked fine.  This is a
> bit of a lie because I ported it using Cygwin32 as I now recall.
> 
> I've added some more variables recently which use the bool type but
> gcc/g++ can't find <bool.h>
> 
> I also have the my own types.h file with the following.
> 
> typedef bool BOOL;
> 
> MinGW32 doesn't seem to like this because the Windows API uses BOOL.  I
> have tried using BOOLEAN but the Windows API seems to use it as well.
> 
> Can some one help me with this.
> 
> Many thanks,
> Brendan Simon.
> 

Hello Brendan!


AFAIK, in the new definition of C++, bool is already defined as
	enum bool {false, true};

I had not any trouble to compile this small program

------------------------------------------
#include <iostream.h>

int main (void)
{
    bool b = true;

    if (b)
    {
        cout << "b is true!\n";
    }
    else
    {
        cout << "b is false!\n";
    }

    return (0);
}

------------------------------------------

And the its output was 

b is true!

as expected.

So, you don't need to define bool again.

HTH


++Hilton
-------------------
Hilton Fernandes
email: hgfernan@usp.br
www:   http://www.lsi.usp.br/~hilton.html (inactive)
M. Sc. Student of Parallel Distributed Applications
at Escola Politecnica (Polytechnic School)
University of S. Paulo - Brazil
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]