Error while compiling program with oci.h

I was developing small utility using C++ some time ago and used Visual Studio as IDE and compiler. I’ve included oci.h to connect to Oracle Database like this

#include <stdio.h>
#include «oci.h»

but got following errors

Error    C2371    ‘BOOLEAN’: redefinition; different basic types
Error    C2632    ‘char’ followed by ‘int’ is illegal
Warning    C4091    ‘typedef ‘: ignored on left of ‘unsigned char’ when no variable is declared
Error (active)    E0084    invalid combination of type specifiers

This is because oratypes.h and Wtypesbase.h (Wtypes.h) have conflict while defining type boolean. Problem was solved by adding «Wtypesbase.h» as first include like this

#include «Wtypesbase.h»
#include <stdio.h>
#include «oci.h»

Добавить комментарий

Ваш e-mail не будет опубликован. Обязательные поля помечены *