I am a newbie in C/C++, just in case :) I have cloned an older protocol stack solution written in C with one main class in C++ imported it into VS (Visual C++ 2017 v 15.9.5 targeting Windows SDK 10.0.17134.0) it compiled correctly and working.
Now made a C++ solution (windows console application) created a folder lib
copy pasted all those .h
and .c
files into lib
added the path to additional include directories
and also in linker additional library directories
.
Building the Solution throwing tones of errors. the one I am trying to fix now is:
One of the header files contains type definitions
typedef uint8_t U8;
#ifndef BOOL
typedef U8 BOOL;
#endif
but this is conflicting with minwindef.h
from windows kit. though I #include types.h
getting C2371 'BOOL': redefinition; different basic types
in the whole solution, I want to use this definition of BOOL
and all other ones defined in this header.
How should I solve the issue? Or in General in case of using C codes in C++ projects what settings and MACRO (e.g. extern "C" in methods) should I follow