I'm compiling a 64 bit c++ project on visual studio pro 2010 and I'm testing the size of pointers. It shows that sizeof(any pointer) such as void*, char* etc is 4 bytes. This seems wrong for a 64 bit system. However, sizeof(UINT_PTR) is 8 which is correct for 64 bit.
Here's my preprocessor definition: _WIN64;_AMD64;_WINDOWS;_DEBUG;_USRDLL;
Target machine is MachineX64 (/MACHINE:X64).
Is there someplace where the sizeof() of things is defined? Otherwise, how can I find out why it's giving me the wrong size?
Thanks.
Edit: Compiler command line:
/Zi /nologo /W4 /WX- /Od /D "_WIN64" /D "_AMD64" /D "_WINDOWS" /D "_DEBUG" /D "_USRDLL" /D "_WINDLL" /D "_MBCS" /D "_AFXDLL" /Gm /EHsc /RTC1 /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fp"x64\Debug\S2TalkerDLL.pch" /Fa"x64\Debug\" /Fo"x64\Debug\" /Fd"x64\Debug\vc100.pdb" /Gd /errorReport:queue
Linker command line:
/OUT:"C:\Users\xxx\Documents\Visual Studio 2010\Projects\S2TalkerDLL\x64\Debug\S2TalkerDLL.dll" /INCREMENTAL /NOLOGO /DLL "WINMM.lib" /DEF:".\S2TalkerDLL.def" /MANIFEST /ManifestFile:"x64\Debug\S2TalkerDLL.dll.intermediate.manifest" /ALLOWISOLATION /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Users\xxx\Documents\Visual Studio 2010\Projects\S2TalkerDLL\x64\Debug\S2TalkerDLL.pdb" /SUBSYSTEM:WINDOWS /PGD:"C:\Users\xxx\Documents\Visual Studio 2010\Projects\S2TalkerDLL\x64\Debug\S2TalkerDLL.pgd" /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X64 /ERRORREPORT:QUEUE


sizeof(void*) == sizeof(UINT_PTR) == 8when I tested on a 64-bit VC++ project. Can you list all the compiler and linker switches you're using? - In silico