views:

393

answers:

3

I'm trying to learn an SDK that requires a header file be included. There are two statements in the header file that says

typedef long long SomeIdentifier_SInt64;

and

typedef unsigned long SomeIdentifier_UInt64;

The compiler (MSVC++ 6) is complaining that this is illegal. If so, does this mean the SDK is broken? I seriously doubt this is the case. Is this legal in other compilers? Is there any way around this?

Thanks.

My environment is MS Windows XP Pro 32-bit.

+1  A: 

VC6 is too old and too broken to know "long long". It will compile __int64. VS200x doesn't have a problem with it.

Hans Passant
Unfortunately I cannot replace the software I use at work. Can I just replace the long long in the header file to __int64? is this considered acceptable practice?
krebstar
Depends on your definition of "acceptable". Most people don't consider VC6 acceptable, but if replacing long long with __int64 works, then it's as acceptable as it's going to get.However, for once VC6 is actually more or less right. long long isn't a valid C++ type. It exists in C, not (yet) in C++
jalf
__int64 *should* work though. On x86, long long is a 64-bit integer. __int64 is simply Microsoft's nonportable name for that datatype.
jalf
Well, my real concern is that I would be modifying an SDK vendor's header file. Anyway, I guess I will probably have to modify it for now.. Thanks..
krebstar
A: 

MSVC6 is a pretty old and crappy compiler. Their latest version is much much much (much) better, and you can download it for free on their website.

It did support __int64 and unsigned __int64 though, so if for some reason you can't use the latest version you can search through the SDK headers and replace every instance of long long you find.

zildjohn01
See my comments in nobugz' answer.. Btw, I can't use the express edition, my work requires MFC..
krebstar
+1  A: 

You need to use the February 2003 version of the Platform SDK.

http://blogs.msdn.com/mapo/archive/2007/06/07/last-platform-sdk-compatible-with-visual-studio-6-0.aspx

Mark Ransom
Is this not included in SP5 of MSVC6?
krebstar
It's quite a big package and I don't know if I have enough resources to download it..
krebstar