Original Post
A lot of 3rd party libraries define their own known precision data types similar to what the C99 standardized stdint.h (cstdint for C++) does. Often the typedefs aren't exactly identical and so compile errors arise when a compilation unit needs to include headers for two such conflicting libraries. A recent example I came across when using SDL and Assimp together (it doesn't matter which order I include the files, both orderings cause compile errors):
#include <include/assimp.hpp>
#include <SDL/SDL.h>
int main(int argc, char *argv[]) {
return 0;
}
c:\external\include\include\compiler\pstdint.h(380) : error C2371: 'uint32_t' : redefinition; different basic types
c:\external\include\sdl\sdl_config_win32.h(38) : see declaration of 'uint32_t'
c:\external\include\include\compiler\pstdint.h(410) : error C2371: 'int32_t' : redefinition; different basic types
c:\external\include\sdl\sdl_config_win32.h(37) : see declaration of 'int32_t'
What is the recommended way of handling this type of problem? What is the responsibility of the library maker, and what is the responsibility of the user, in order to solve it?