I port my code from Windows to Linux. There is no type __int64 on Linux, so I tried to define it myself using an alias. My code is as follows:
#include <cstdint>
#if !defined(__int64)
typedef int64_t __int64;
#endif
int main(int argc, char** argv)
{
unsigned __int64 ii64 = 0;
return 0;
};
When I compiled it, I got the following error:
main.cpp: In the function 'int main (int, char **): main.cpp: 10: 20: error: expected initializer before' ii64
I know that I can replace "unsigned __int64" with "uint64_t" or define a new type, but why can't the previous code compile?
source
share