[opensource-dev] C++ Need help to resolve stdint.h typedef conflicts between Quicktime and VS2010

Kiptic ‌ kiptic at hotmail.com
Tue Apr 5 14:12:00 PDT 2011


>  media_plugin_quicktime.cpp
> C:\Program Files (x86)\QuickTime SDK\CIncludes\GNUCompatibility/stdint.h(49): 
> error C2371: 'int_fast16_t' : redefinition; different basic types
>           C:\Program Files (x86)\Microsoft Visual Studio 
> 10.0\VC\include\stdint.h(34) : see declaration of 'int_fast16_t'

> there are more errors like these but the same header just different int's

> I have tried #include <stdint.h> and #undef and that doesn't help.

Oh, interesting, I just had the same problem after switching to VS2010. Thought I'd share my solution :)

It turns out the geniuses at Microsoft had decided not to include stdint.h in their include directory (which is required by the C99 standard, that Microsoft apparently ignores).

This got the Apple people worried, so they added their own stdint.h to the QuickTime SDK. Nice, except that now for some unknown reason Microsoft decided it was time to add stdint.h to VS2010! Obviously with completely different definitions :)

Also, they failed defining the standard _STDINT_H that would tell other headers it exists, instead they define _STDINT only. Brilliant.

So, I had to do this:

1. In C:\Program Files (x86)\QuickTime SDK\CIncludes\CoreFoundation, comment out this on line 36:
#include <GNUCompatibility/stdint.h>

2. In C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdint.h (keep a copy of the original if you like!), change line 4 from this:
#define _STDINT

...to this:
#define _STDINT
#define _STDINT_H

Voilà it now compiles properly, and so should everything else that uses stdint.h!

/Kip

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.secondlife.com/pipermail/opensource-dev/attachments/20110405/8627e401/attachment-0001.htm 


More information about the opensource-dev mailing list