Hello,
I am including one dynamics library in my visual studio 2017 project and I am getting this error "byte is ambiguous". I tried std::byte, #undef _HAS_STD_BYTE before including headers but none of them worked for me and I've got many errors. Also I am not able to modify the header file and whenever I try to do so it says access to the path is denied.
1 2 3 4
#define small char
typedefunsignedchar byte;
typedef byte cs_byte; //error happens in this line and when I change to std::byte" the error disappear but I can't save the changes in the header file
typedefunsignedchar boolean;
Byte would work as Byte and byte are considered different types as the name is case sensitive.
In another header the type byte is defined as something different to unsigned char. Have you done a header search for byte to see where else it's defined?
Changing basic types to new names just makes the code harder to read.
c++ has bool, and it has uint8_t (8 bits, one byte, standard name if someone didn't get that they can read documentation on it)
worse, by using char, there are magical things done to cout and in a couple of other places that treat char differently. If you hide it as a special integer type, then try to print it, you get gibberish instead of digits and it can be hard to see why esp if inexperienced.
I recommend not doing this at all, ever (again, talking simple built in type renames only). Opinions vary of course, you certainly CAN do it, and if required to do so, you can be stuck with it.
being a problem with windows.h figures. Many issues always seem to come back to that monstrosity! I always use WIN32_LEAN_AND_MEAN when using windows.h unless I get compile errors because.
#define WIN32_LEAN_AND_MEAN before including windows.h means that a bunch of stuff is bypassed in the include files used. There's pre-compiler tests for this in various places.