Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/64.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ g++;错误:word64未命名类型_C++_C_G++_64 Bit - Fatal编程技术网

C++ g++;错误:word64未命名类型

C++ g++;错误:word64未命名类型,c++,c,g++,64-bit,C++,C,G++,64 Bit,我试图编译一个软件包,但编译时出现了这个错误 sha.cpp:29: error: ‘word64’ does not name a type 我浏览了源代码。相关部分是 #if HAVE64 word64 bytes; #else word32 bytesHi, bytesLo; #endif 来自sha.cpp,第29-33行 我发现word64在另一个文件中以如下方式声明 #include <limits.h> #ifdef __cplusplus ext

我试图编译一个软件包,但编译时出现了这个错误

sha.cpp:29: error: ‘word64’ does not name a type
我浏览了源代码。相关部分是

#if HAVE64
    word64 bytes;
#else
    word32 bytesHi, bytesLo;
#endif
来自sha.cpp,第29-33行

我发现word64在另一个文件中以如下方式声明

#include <limits.h>

#ifdef __cplusplus
extern "C" {
#endif

#if UCHAR_MAX == 0xff
typedef unsigned char byte;
typedef signed char int8;
#else
#error This machine has no 8-bit type
#endif

#if UINT_MAX == 0xffff
typedef uint word16;
typedef int int16;
#elif USHRT_MAX == 0xffff
typedef unsigned short word16;
typedef short int16;
#else
#error This machine has no 16-bit type
#endif

#if UINT_MAX == 0xfffffffful
typedef uint word32;
typedef int int32;
#elif ULONG_MAX == 0xfffffffful
typedef ulong word32;
typedef long int32;
#else
#error This machine has no 32-bit type
#endif

#if ULONG_MAX > 0xfffffffful
#if ULONG_MAX == 0xfffffffffffffffful
typedef ulong bnword64;
#define BNWORD64 bnword64
#define HAVE64 1
#endif
#endif



#ifndef HAVE64
#if defined(ULONG_LONG_MAX) || defined (ULLONG_MAX) || defined(ULONGLONG_MAX)
typedef unsigned long long word64;
typedef long long int64;
#define HAVE64 1
#endif
#endif
我用来编译的编译器

g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4)
我浏览了互联网,想把这个东西修好,但没有找到任何线索。
任何帮助都将不胜感激

您似乎在某个地方缺少一个头文件,其中定义了word64和word32。尝试通过文本搜索查找该库。如果您没有找到该库,那么很难找出该库的作者试图将其定义为word63/32

您可以尝试以下猜测(这是一个猜测,因此可能不起作用):在引用的片段之前,向sha.cpp添加以下行:

#include <stdint.h>

typedef uint64_t word64;
typedef uint32_t word32;
#包括
typedef uint64_t word64;
typedef uint32_t word32;
或者,如果这不起作用,请尝试以下方法:

#include <stdint.h>

typedef int64_t word64;
typedef int32_t word32;
#包括
typedef int64_t word64;
typedef int32_t word32;

祝你好运

对于
word64
word32
,似乎缺少
typedef
。你搜索过代码库吗?如果PO会评论事情的进展,如果他/她尝试过任何事情,是否有效,那不是很好吗?你输入了错误的类型名称;它应该是
typedef uint64\u t word64;typedef int64_t int64#include <stdint.h>

typedef int64_t word64;
typedef int32_t word32;