2

I'm writing a header file for binary search tree, however when i compiled visual studio 2012 compiler does not recognized stdbool.h header.I got this error:

error C1083: Cannot open include file: 'stdbool.h': No such file or directory   

why am i getting this error ?

I tried it with the code block compiler and still got the same error, I'll post my file below Thank you in advance for helping.

/Header file for binary search tree/

#include <stdio.h>
#include <stdbool.h>

// Structure Declarations

typedef struct
    {
        void* dataPtr;
        struct node* left;
        struct node* right;
    }NODE;

typedef struct
    {
        int count;
        int (*compare) (void* argu1, void* argu2);
        NODE* root;
    }BST_TREE;

// Prototype declarations
   BST_TREE* BST_Create
            (int (*compare) (void* argu1, void* agu2));
   BST_TREE* BST_Destroy (BST_TREE* tree);
   bool BST_Insert    (BST_TREE* tree, void* dataPtr);
   bool BST_Delete    (BST_TREE* tree, void* dltKey);
   void* BST_Retrieve (BST_TREE* tree, void* dataPtr);
   void* BST_Traverse (BST_TREE* tree,
                       void (*process) (void* dataPtr));

   bool BST_Empty (BST_TREE* tree);
   bool BST_Full  (BST_TREE* tree);
   int  BST_Count  (BST_TREE* tree);

   static NODE* _insert
                   (BST_TREE* tree, NODE* root,
                    NODE* newPtr);
   static NODE* _delete
                   (BST_TREE* tree, NODE* root,
                    void* dataPtr, bool* success);
   static NODE* _retrieve
                   (BST_TREE* tree, 
                   void* dataPtr, NODE* root);
   static NODE* _traverse
                   (NODE* root,
                    void (*process) (void* dataPtr));
   static NODE* _destroy ( NODE* root);
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
bluebk
  • 169
  • 1
  • 6
  • 21
  • 1
    I don't know if VS2012 includes `stdbool.h` (previous versions did not as far as I know), but there is no such thing as "Code::Blocks compiler". Code::Blocks is an IDE. It will use any compiler it detects/you specify for the actual compilation, so there is a good chance you are actually still using the VS compiler. – Baruch Aug 05 '13 at 12:50

0 Answers0