Warning[Pe301]: typedef name has already been declared (with same type)

编译警告

#ifndef TYPES_H
#define TYPES_H

// datatypes
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long ulong_t;
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed int int32_t;
typedef signed long long_t;

typedef enum
{
false = 0,
true = 1
}bool_e;

#endif

Warning[Pe301]: typedef name has already been declared (with same type)
这个警告的意思是这个类型已经被定义过了,可是这程序里不是有#ifndef #endif。
所以有可能像这些unsigned char 等在 有头文件里面已经定义为Uint8等了,再次定义可能就警告了。

还有一种就是定义的结构类型重复:https://blog.csdn.net/zghforever/article/details/59133773
解决办法之一,就是再建立一个文件test_type.h;在test.h中包含test_type.h就可以了。emmmm

你可能感兴趣的:(算法,c++,开发语言,c语言,visual,studio)