When I tried to compile Box2D into my application. Found out that the type abstraction is conflicting with other libraries.
Would be good if Box2D make use of native data types instead to avoid conflict with other existing libraries
Example: int - int32 , short - int16
Is there a remedy to this?
What is the compiler error?
Oops, I have the changes to box2d already.
It has something to do with your typedefs in b2settings.h
I changed the following:
//typedef signed char char;
//typedef signed short short;
//typedef signed int int;
typedef unsigned char uchar;
typedef unsigned short ushort;
typedef unsigned int uint;
//typedef float float;
And changed all those back to their native c++ types again.
The problem is that Box2D might need to have an int64, for example. How that is achieved with native types can vary by platform. So I can't use native types without digging myself into a hole.
C99 standard defines integer types in <stdint.h> and/or <inttypes.h>:
int8_t, uint8_t, int6_t, uint16_t..... int64_t, uint64_t.
The Wikipedia states that the file is not distributed with Visual Studio (what a standard-conforming product), but also offers download of two implementation, one under BSD license, and the second one under Apache-style license.
Im not sure about other compilers (Im using Visual Studio)
If there are two header files with similar typedefs...will it work? Or will it be conflicting as well?
Identical typedefs should work. That's why I was curious about the compiler error.