Declaration does not declare anything C++ error

578 Views Asked by At

I'm having a problem with the NIOS 2 SD Card Libary.

The problem is referenced to this part of the libary:

#ifndef bool
    typedef enum e_bool { false = 0, true = 1 } bool;
#endif

The NIOS Eclipse compiler resulted me this error:

declaration does not declare anything

What might be causing this issue?

1

There are 1 best solutions below

0
Elvis Dukaj On

in C++ bool is a keyword not a macro so the code above inside the ifdef is skipped and not compiled.

In C code sometimes bool is defined as a macro

#define bool int
#define true 1
#define false 0